3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function test1($unset = false) { static $bar = 1; $bar++; echo $bar; unset($bar); /* $bar = " | "; echo $bar; static $bar = 5; $bar++; echo $bar; //*/ } function test2($unset = false) { static $bar = 1; $bar++; echo $bar; unset($bar); $bar = " | "; echo $bar; static $bar = 5; $bar++; echo $bar; } test1(); test1(); test1(); test1(); echo "\n"; test2(); test2(); test2(); test2();
Output for 4.3.0 - 7.1.0
2345 6 | 78 | 910 | 1112 | 13