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; // this initialization value is hoisted to the top of the function! static $bar = 5; $bar++; echo $bar; echo " "; static $bar = 77; } var_dump($bar); test1(); test1(); test1(); test1();
Output for git.master, git.master_jit
Warning: Undefined variable $bar in /in/kuZGc on line 24 NULL 78|79 80|81 82|83 84|85
Output for rfc.property-hooks
Fatal error: Duplicate declaration of static variable $bar in /in/kuZGc on line 15
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:
39.48 ms | 401 KiB | 8 Q