3v4l.org

run code in 300+ PHP versions simultaneously
<?php $testVar = 'foo'; // list of keys to ignore (including the name of this variable) $ignore = array('GLOBALS', '_FILES', '_COOKIE', '_POST', '_GET', '_SERVER', '_ENV', 'ignore'); // diff the ignore list as keys after merging any missing ones with the defined list $vars = array_diff_key(get_defined_vars() + array_flip($ignore), array_flip($ignore)); // should be left with the user defined var(s) (in this case $testVar) var_dump($vars);
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { ["argv"]=> array(1) { [0]=> string(9) "/in/ehccq" } ["argc"]=> int(1) ["testVar"]=> string(3) "foo" }

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:
41.27 ms | 401 KiB | 8 Q