Consider following code snippet:
function show() {
    STATIC $count = 0;
    return ++$count;
print show();
print show();
print show(); 
What is the result of executing the code above?
The result is 123, because we use PRE increment and STATIC variable, that is means the value will be stored after executing show() function;
PHP Quiz
Start Quiz

or Read more about PHP Quiz

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback