3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { global $color; include 'vars.php'; echo "A $color $fruit"; } /* vars.php is in the scope of foo() so * * $fruit is NOT available outside of this * * scope. $color is because we declared it * * as global. */ foo(); // A green apple echo "A $color $fruit"; // A green ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: include(): open_basedir restriction in effect. File(vars.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/4KvaP on line 7 Warning: include(vars.php): Failed to open stream: Operation not permitted in /in/4KvaP on line 7 Warning: include(): Failed opening 'vars.php' for inclusion (include_path='.:') in /in/4KvaP on line 7 Warning: Undefined variable $fruit in /in/4KvaP on line 9 A Warning: Undefined variable $fruit in /in/4KvaP on line 18 A

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:
47.37 ms | 402 KiB | 8 Q