3v4l.org

run code in 300+ PHP versions simultaneously
<?php function unset_globals($array) { if(!is_array($array)) { return; } foreach(array_keys($array) as $key) { unset($GLOBALS[$key]); unset($GLOBALS[$key]); // Double unset to circumvent the zend_hash_del_key_or_index hole in PHP <4.4.3 and <5.1.4 } } $ryat = 'haha'; //var_dump($GLOBALS); //$_GET['GLOBALS'] = 'hi'; $_GET['ryat'] = 'hi'; $_GET['_GET'] = 'hi'; //var_dump($GLOBALS); unset_globals($_GET); var_dump($GLOBALS); echo $ryat; var_dump($_COOKIE);
Output for git.master, git.master_jit, rfc.property-hooks
array(6) { ["_POST"]=> array(0) { } ["_COOKIE"]=> array(0) { } ["_FILES"]=> array(0) { } ["argv"]=> array(1) { [0]=> string(9) "/in/MQZMO" } ["argc"]=> int(1) ["_SERVER"]=> array(17) { ["TERM"]=> string(5) "xterm" ["PATH"]=> string(13) "/usr/bin:/bin" ["LANG"]=> string(1) "C" ["SHELL"]=> string(7) "/bin/sh" ["MAIL"]=> string(16) "/var/mail/nobody" ["LOGNAME"]=> string(6) "nobody" ["USER"]=> string(6) "nobody" ["HOME"]=> string(4) "/tmp" ["PHP_SELF"]=> string(9) "/in/MQZMO" ["SCRIPT_NAME"]=> string(9) "/in/MQZMO" ["SCRIPT_FILENAME"]=> string(9) "/in/MQZMO" ["PATH_TRANSLATED"]=> string(9) "/in/MQZMO" ["DOCUMENT_ROOT"]=> string(0) "" ["REQUEST_TIME_FLOAT"]=> float(1394080190.0001) ["REQUEST_TIME"]=> int(1394080190) ["argv"]=> array(1) { [0]=> string(9) "/in/MQZMO" } ["argc"]=> int(1) } } Warning: Undefined variable $ryat in /in/MQZMO on line 23 array(0) { }

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:
37.48 ms | 403 KiB | 8 Q