3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php ${0xFF} = 'Hello Peter'; // $GLOBALS['255'] ${2 + 2} = 'Hello Peter'; // $GLOBALS['4'] ${'_SESSION'} = 'test'; // $GLOBALS['Hello Peter'] ${'_SERVER'} = 'test'; // $GLOBALS['Hello Peter'] var_dump($GLOBALS, $_SESSION);
based on XQZqs
Output for 7.0.0 - 7.3.0rc3
array(11) { ["_GET"]=> array(0) { } ["_POST"]=> array(0) { } ["_COOKIE"]=> array(0) { } ["_FILES"]=> array(0) { } ["argv"]=> array(1) { [0]=> string(9) "/in/29LQJ" } ["argc"]=> int(1) ["_SERVER"]=> string(4) "test" ["GLOBALS"]=> array(11) { ["_GET"]=> array(0) { } ["_POST"]=> array(0) { } ["_COOKIE"]=> array(0) { } ["_FILES"]=> array(0) { } ["argv"]=> array(1) { [0]=> string(9) "/in/29LQJ" } ["argc"]=> int(1) ["_SERVER"]=> string(4) "test" ["GLOBALS"]=> *RECURSION* ["255"]=> string(11) "Hello Peter" ["4"]=> string(11) "Hello Peter" ["_SESSION"]=> string(4) "test" } ["255"]=> string(11) "Hello Peter" ["4"]=> string(11) "Hello Peter" ["_SESSION"]=> string(4) "test" } string(4) "test"
Output for 5.6.0 - 5.6.26
array(11) { ["_GET"]=> array(0) { } ["_POST"]=> array(0) { } ["_COOKIE"]=> array(0) { } ["_FILES"]=> array(0) { } ["argv"]=> array(1) { [0]=> string(9) "/in/29LQJ" } ["argc"]=> int(1) ["_SERVER"]=> string(4) "test" ["GLOBALS"]=> *RECURSION* ["255"]=> string(11) "Hello Peter" ["4"]=> string(11) "Hello Peter" ["_SESSION"]=> string(4) "test" } string(4) "test"