What will be the output of the following PHP code ?
<?php
function fun()
{
static $x = 0;
echo $x;
$x++;
}
fun();
fun();
fun();
?>
<?php
function fun()
{
static $x = 0;
echo $x;
$x++;
}
fun();
fun();
fun();
?>
A. 012
B. 123
C. 111
D. Error
Answer: Option A
Join The Discussion