3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test1() { // We have to check for existance because each call will try to define the function globally like including a file would. if (!function_exists('test2')) { function test2() { echo 'there' . PHP_EOL; } } echo 'here' . PHP_EOL; } echo "The internal method isn't defined yet: "; var_dump(function_exists('test2')); test1(); echo "Woops, function definitions don't get scoped by the function that define them. That's a feature but now we accidentally have a global function we might not have intended!: "; var_dump(function_exists('test2')); test2();
Output for git.master_jit, git.master, rfc.property-hooks
The internal method isn't defined yet: bool(false) here Woops, function definitions don't get scoped by the function that define them. That's a feature but now we accidentally have a global function we might not have intended!: bool(true) there

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:
27.75 ms | 406 KiB | 5 Q