What will be the output of the following code?
<?php
function changeme()
{
static $var=5;
return $var++;
}
echo changeme();
echo changeme();
echo changeme();
?>
a) 678
b) 567
c) 555
d) None of these
Solution: any guesses?
its b) 567
<?php
function changeme()
{
static $var=5;
return $var++;
}
echo changeme();
echo changeme();
echo changeme();
?>
a) 678
b) 567
c) 555
d) None of these
Solution: any guesses?
its b) 567
No comments:
Post a Comment