PHP

A colorful and engaging illustration of a computer screen displaying PHP code, with a graduation cap and question marks around it, symbolizing learning and assessment.

PHP Mastery Quiz

Test your knowledge and understanding of PHP with this engaging quiz designed for enthusiasts and developers alike. Whether you're a beginner or an expert, this quiz will challenge your skills and enhance your learning.

Key Features:

  • 10 multiple choice questions
  • Instant feedback on answers
  • Explore different aspects of PHP programming
10 Questions2 MinutesCreated by DebuggingDolphin37

What will be the output of the following PHP code?

<?php

$a = 5;

$b = 5;

echo ($a === $b);

?>

5 === 5
Error
1
False
Which of the below symbols is a newline character?
\r
\n
/n
/r

What will be the output of the following PHP code?

<?php

$num = 10;

echo 'What is her age? \n She is $num years old';

?>

What is her age? \n She is $num years old
What is her age? She is $num years old
What is her age? She is 10 years old
What is her age? She is 10 years old

Which of the conditional statements is/are supported by PHP?

i) if statements

ii) if-else statements

iii) if-elseif statements

iv) switch statements

Only i)
I), ii) and iv)
Ii), iii) and iv)
All of the mentioned.

What will be the output of the following PHP code?

 

<?php

$team = "arsenal";

switch ($team) {

case "manu":

echo "I love man u";

case "arsenal":

echo "I love arsenal";

case "manc":

echo "I love manc"; }

?>

I love arsenal
Error
I love arsenalI love manc
I love arsenalI love mancI love manu

Which of the looping statements is/are supported by PHP?

i) for loop

ii) while loop

iii) do-while loop

iv) foreach loop

i) and ii)
) i), ii) and iii)
All of the mentioned
None of the mentioned

What will be the output of the following PHP code?

 

<?php

$user = array("Ashley", "Bale", "Shrek", "Blank");

for ($x=0; $x < count($user); $x++) {

if ($user[$x] == "Shrek") continue;

printf ($user[$x]);

}

?>

AshleyBale
AshleyBaleBlank
ShrekBlank
Shrek
If $a = 12 what will be returned when ($a == 12) ? 5 : 1 is executed?
12
1
Error
5

What is the value of $a and $b after the function call?

 

<?php

 

function doSomething( &$arg ) {

$return = $arg;

$arg += 1;

return $return;

}

$a = 3;

$b = doSomething( $a );

?>

a is 3 and b is 4
A is 4 and b is 3
Both are 3
Both are 4
Who is the father of PHP?
Rasmus Lerdorf
Willam Makepiece
Drek Kolkevi
List Barely
{"name":"PHP", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Test your knowledge and understanding of PHP with this engaging quiz designed for enthusiasts and developers alike. Whether you're a beginner or an expert, this quiz will challenge your skills and enhance your learning.Key Features:10 multiple choice questionsInstant feedback on answersExplore different aspects of PHP programming","img":"https:/images/course5.png"}
Powered by: Quiz Maker