3v4l.org

run code in 300+ PHP versions simultaneously
<?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 git.master, git.master_jit
2345 6 | 78 | 910 | 1112 | 13
Output for rfc.property-hooks
Fatal error: Duplicate declaration of static variable $bar in /in/RT1Is on line 34
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
37.26 ms | 401 KiB | 8 Q