R

Ram Sharma • 193.86K 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

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.