Online Test for PHP

  1. PHP is an open source software
    True
    False

  1. Which of those is not magic method?
    __autoload
    __clone
    __sleep
    __toint


  1. Find Error/Output in follwing code:
  2.                                 
    <?php
    
    $strings 
    'test test';
    if (
    ctype_alpha($strings)) {
      echo 
    "The string consists of all letters.";
    } else {
      echo 
    "The string does not consist of all letters.";
    }
    ?>
    The string does not consist of all letters.
    The string consists of all letters.
    Fatal Error
    Syntax Error

  1. __FILE__ is ?
    Language construct
    Keyword
    Compile-time constant
    None of the above

  1. Which of the following is a correct way to declare constant variable?
    const $CONSTANT = 'constant value';
    const CONSTANT = 'constant value';
    const CONSTANT = $a * $b;
    All of the above

  1. What is the name of function used to convert an array into a string?
    explode()
    glue()
    implode()
    None of the above


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

  1. In terms of keywords and language syntax, PHP is similar to?
    C
    COBOL
    FORTRAN
    .Net

  1. PEAR stands for?
    PHP Extension and Application Record
    PHP Extended and Application Repository
    PHP Extension and Application Repository
    PHP Extension and Applicable Repository

Post Your Question
Social Sharing
Search