Online Test for PHP

  1. Parent constructors are not called implicitly if the child class defines a constructor.
    True
    False

  1. Static methods can be call with class name and colon operator, $this is not available inside the method declared as static.
    True
    False


  1. Which keyword cannot be used while defining property?
    Public
    Static
    Final
    Private

  1. Array values are keyed by ______ values (called indexed arrays) or using ______ values (called associative arrays).
    Float, string
    Even number, string
    String, Boolean
    Integer, string


  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. PHP is an open source software
    True
    False

  1. microtime() returns _______.
    current Unix timestamp with seconds
    current Unix timestamp with nanoseconds
    current Unix timestamp with microseconds
    None of the above

  1. How are session variables accessed through?
    $_GET
    $_POST
    $_REQUEST
    None of the above

Post Your Question
Social Sharing
Search