ExamVeda
Login
Home
Operators and Expressions in php
?

What will be the output of the following PHP code ?
<?php
static $x = 0;
function fun()
{
    echo $x;
    $x++;
}
fun();
fun();
fun();
?>

Answer & Solution
Correct Answer: Option C
Since variable x is not defined inside the function fun(), nothing will be printed.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.