3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (true) { function test_func1($string) { return $string; } $value = test_func1("defined before"); } echo $value; echo "\n---\n"; if (true) { $value = test_func2("defined after"); function test_func2($string) { return $string; } } echo $value;
Output for git.master, git.master_jit, rfc.property-hooks
defined before --- Fatal error: Uncaught Error: Call to undefined function test_func2() in /in/oo9iu:14 Stack trace: #0 {main} thrown in /in/oo9iu on line 14
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.9 ms | 401 KiB | 8 Q