My Report

PHP Basic Online Test – 1


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement

1. Which of the following must be installed on your computer so as to run PHP script?

i) Adobe Dreamweaver 
ii) XAMPP
iii) Apache and PHP
iv) IIS

2. Which of the following PHP statement/statements will store 111 in variable num?

    i) int $num = 111;
    ii) int mum = 111;
    iii) $num = 111;
    iv) 111 = $num;

3. What should be the correct syntax to write a PHP code?

4. Which of the following is/are a PHP code editor?

    i) Notepad
    ii) Notepad++
    iii) Adobe Dreamweaver
    iv) PDT

5. Which version of PHP introduced Try/catch Exception?

6. How should we add a single line comment in our PHP code?

    i) /?
    ii) //
    iii) #
    iv) /* */

7. What will be the output of the following PHP code?

    <?php
    $num  = "1";
    $num1 = "2";
    print $num+$num1;
    ?>
    

8. What does PHP stand for?

   i) Personal Home Page
   ii) Hypertext Preprocessor
   iii) Pretext Hypertext Processor
   iv) Preprocessor Home Page

9. PHP files have a default file extension of_______

10. What will be the output of the following PHP code?

    <?php
    $num  = 1;
    $num1 = 2;
    print $num . "+". $num1;
    ?>
    

 

Start practicing “1000 MCQs on PHP”, and once you are ready, you can take tests on all topics by attempting our “PHP Test Series”.

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.