Source Code:
(back to article)
<?php function myFunction() { static $x = 0; echo $x; $x++; } myFunction(); // Outputs 0 myFunction(); // Outputs 1 myFunction(); // Outputs 2 ?>
Result:
Report an issue