R

Ram Sharma • 193.88K Points
Coach

Q. what is the output of below program?

Code:
<?php
function hello(){
echo "hello";
hello();
}

hello();
?>
  • (A) hello
  • (B) hello hello
  • (C) hello is printed infinite times
  • (D) Compilation Error
  • Correct Answer - Option(C)
  • Views: 20596
  • Filed under category PHP

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Comments (1)

  • R
    Yes, Option (C) is correct because, hello() function is printing hello string and also calling itself inside that function so it will print hello infinite times. Your program may be crashed.

Question analytics