3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test1($unset = false) { // PHP establishes an internal static var and binds // the local name 'bar' to it static $bar = 5; $bar++; echo $bar . " "; // unlink the name 'bar' from the internal static var unset($bar); $bar = " | "; echo $bar; static $bar = 10; $bar++; echo $bar . " "; } test1(); test1(); test1(); test1();
Output for git.master, git.master_jit
11 | 12 13 | 14 15 | 16 17 | 18
Output for rfc.property-hooks
Fatal error: Duplicate declaration of static variable $bar in /in/23oBR on line 20
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:
46.47 ms | 401 KiB | 8 Q