Online Test for PHP

  1. list in PHP is ?
    Language construct
    Keyword
    A & C Both
    None of the above

  1. Class member variables are also called?
    Properties
    Fields
    Attributes
    All of the above


  1. Find Error/Output in follwing code:
  2.                                 
    <?php
    
    $val1 
    42;
    if(
    ctype_digit($val1)) {
      echo 
    "Integer";
    } else {
      echo 
    "Not Integer";
    }

    $val2 '42';
    if(
    ctype_digit($val2)) {
      echo 
    "Integer";
    } else {
      echo 
    "Not Integer";
    }
    ?>
    Not Integer Integer
    Integer Not Integer
    Integer Integer
    Not Integer Not Integer

  1. PECL stands for?
    PHP Extension Community Laboratory
    PHP Extension Combined Library
    PHP Export Community Library
    PHP Extension Community Library

  1. Static properties can be accessed through the object using the arrow operator ->.
    True
    False

  1. PHP allow which commenting style?
    /* */
    //
    #
    All the above


  1. If property of class is declare using var then PHP5 will treat the property as?
    Protected
    Private
    Public
    Final

  1. The break statement ends execution of which of the following?
    while
    for
    switch
    All of the above

  1. The variable name is case-sensitive in PHP.
    True
    False

  1. Which object-oriented pattern would you use to implement a class that must be instantiated only once for the entire lifespan of a script?
    Model-view-controller
    Abstract factory
    Singleton
    Proxy

Post Your Question
Social Sharing
Search