Discussion :: PHP - CS
-
What will be the output of the following PHP code ?
<?php
function fun()
{
$x = 0;
echo $x;
$x++;
}
fun();
fun();
fun();
?>
Answer : Option C
Explanation :
Every time the function is called the value of x becomes 0, therefore we get 0 on every function call.
Be The First To Comment