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'; //$_GET['GLOBALS'] = 'hi'; $_GET['ryat'] = 'hi'; unset_globals($_GET); echo $ryat;

preferences:
37.49 ms | 402 KiB | 5 Q