3v4l.org

run code in 300+ PHP versions simultaneously
<?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(); test2(); test2(); test2(); test2();
Output for git.master, git.master_jit
6 7 8 9 11 | 12 13 | 14 15 | 16 17 | 18
Output for rfc.property-hooks
Fatal error: Duplicate declaration of static variable $bar in /in/7PeOe 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:
96.26 ms | 401 KiB | 8 Q