3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test1($unset = false) { static $bar = 1; $bar++; echo $bar; unset($bar); echo $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(); static $bar = 1337;
Output for git.master, git.master_jit
6 Warning: Undefined variable $bar in /in/GK7GK on line 11 |7 8 Warning: Undefined variable $bar in /in/GK7GK on line 11 |9 10 Warning: Undefined variable $bar in /in/GK7GK on line 11 |11 12 Warning: Undefined variable $bar in /in/GK7GK on line 11 |13
Output for rfc.property-hooks
Fatal error: Duplicate declaration of static variable $bar in /in/GK7GK on line 16
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:
38.56 ms | 401 KiB | 8 Q