PHP ZCE mock test, interview preparation, daily lessons under chalk talk

Thursday, January 19, 2012

Output of the following code?

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

No comments:

Post a Comment