PHP basic quiz quiz

Basic PHP quiz that covers PHP syntax, data types, control flow and common PHP methods.

This quiz is in PHP quiz collection.

Start quiz
  • 1.

    What value is printed for "a" below?

    <?php
        $a = 1;
        function Test()
        {
            echo "a = $a";
        }
        Test();
    ?>
  • 2.

     Which of the following is true about php.ini file?

  • 3.

    Is PHP whitespace sensitive?

  • 4.

    What gets printed?

    $var = 'false';
    if ($var) {
        echo 'true';
    } else {
        echo 'false';
    }
  • 5.

    What will be printed by the below code?

    $a = 1;
    {
      $a = 2;
    }
    echo $a, "\n";
  • 6.

    What will be printed?

    $a = array();
    if ($a[1]) null;
    echo count($a), "\n";
  • 7.

    PHP server scripts are surrounded by delimiters, which?

  • 8.

    Which of the following is correct about determine the "truth" of any value not already of the Boolean type?

  • 9.

    Which of the following is correct about determine the "truth" of any value not already of the Boolean type?

  • 10.

    Which of the following is correct about determine the "truth" of any value not already of the Boolean type?

  • 11.

    Which of the following magic constant of PHP returns class method name?

  • 12.

    Which of the following can be used to get information sent via get/post method in PHP?

  • 13.

    What does PHP stand for?

  • 14.

    Which of the following is the way to create comments in PHP?

  • 15.

    A value that has no defined value is expressed in PHP with the following keyword:

© 2017 QuizBucket.org