3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function test1($unset = false) { static $bar = 1; $bar++; echo $bar; unset($bar); $bar = "|"; echo $bar; // this initialization value is hoisted to the top of the function! static $bar = 5; $bar++; echo $bar; echo " "; } test1(); test1(); test1(); test1();
Output for 4.3.0 - 7.2.0
6|7 8|9 10|11 12|13