3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function test1($unset = false) { static $bar = 5; $bar++; echo $bar . " "; unset($bar); /* $bar = " | "; echo $bar; static $bar = 10; $bar++; echo $bar . " "; //*/ } function test2($unset = false) { static $bar = 5; $bar++; echo $bar . " "; unset($bar); $bar = " | "; echo $bar; static $bar = 10; $bar++; echo $bar . " "; } test1(); test1(); test1(); test1(); echo "\n"; test2(); test2(); test2(); test2();
Output for 4.3.0 - 7.1.0
6 7 8 9 11 | 12 13 | 14 15 | 16 17 | 18