3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Testing Globals $GLOBALS['A'] = 'B'; $arrayCopyGlobalsVar = $GLOBALS; $arrayCopyGlobalsVar['A'] = 'C'; var_dump([ '$GLOBALS' => $GLOBALS['A'], '$arrayCopyGlobalsVar' => $arrayCopyGlobalsVar['A'], ]); $GLOBALS['A'] = 'B'; $nonReferencedGlobalsVar = new ArrayObject($GLOBALS); $nonReferencedGlobalsVar = $nonReferencedGlobalsVar->getArrayCopy(); $nonReferencedGlobalsVar['A'] = 'D'; var_dump([ '$GLOBALS' => $GLOBALS['A'], '$nonReferencedGlobalsVar' => $nonReferencedGlobalsVar['A'] ]);
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { ["$GLOBALS"]=> string(1) "B" ["$arrayCopyGlobalsVar"]=> string(1) "C" } array(2) { ["$GLOBALS"]=> string(1) "B" ["$nonReferencedGlobalsVar"]=> string(1) "D" }

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:
24.83 ms | 405 KiB | 5 Q