πŸ“Š PHP
Q. As the namespace size grows, using namespaces can become a little repetitious, but PHP also provides the . . . . . statement, which allows you to alias a specific namespace.
  • (A) php
  • (B) grant
  • (C) use
  • (D) label
πŸ’¬ Discuss
βœ… Correct Answer: (C) use
πŸ“Š PHP
Q. Some PHP code might not have a namespace and therefore lives in the . . . . . . namespace.
  • (A) Default
  • (B) Global
  • (C) PRE
  • (D) Automatic
πŸ’¬ Discuss
βœ… Correct Answer: (B) Global
πŸ“Š PHP
Q. The value of __NAMESPACE__ is a string that contains the current namespace name. In global, un-namespaced code, it contains . . . . . .
  • (A) NULL
  • (B) 0
  • (C) an empty string
  • (D) gibberish value
πŸ’¬ Discuss
βœ… Correct Answer: (C) an empty string
πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
"Hello World"
?>
  • (A) Error
  • (B) Hello World
  • (C) Nothing
  • (D) Missing semicolon error
πŸ’¬ Discuss
βœ… Correct Answer: (C) Nothing
πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
print_r "Hello world"
?>
  • (A) Error
  • (B) Hello World
  • (C) Nothing
  • (D) Missing semicolon error
πŸ’¬ Discuss
βœ… Correct Answer: (A) Error
πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
$color = "red";
echo "$color";
echo "$COLOR";
echo "$Color";
?>
  • (A) redredred
  • (B) redred
  • (C) red
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (C) red
πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
 # echo "Hello world";
 echo "# Hello world"; 
?>
  • (A) # Hello world
  • (B) Hello world# Hello world
  • (C) Hello world
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (A) # Hello world
πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
echo "Hello World"
?>
  • (A) Hello world
  • (B) Hello world in italics
  • (C) Nothing
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (B) Hello world in italics
πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
echo "echo "Hello World"";
?>
  • (A) Hello world
  • (B) echo β€œHello world”
  • (C) echo Hello world
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (D) Error
πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
<?php
echo "Hello world";
?>
?>
  • (A) Hello
  • (B) Hello world
  • (C) Nothing
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (D) Error