3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $_POST['abe'] = "love"; // Er magic_quotes_gpc aktiv? if(get_magic_quotes_gpc()) { // Vi gemmer vores HTTP variabler som referencer, altså // er dette en reference til den aktuelle variabel $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST); print_r($process); // Vi gemmer hver enkelt references key og value, for at // behandle dem i en løkke while(list($key, $val) = each($process)) { // foreach($val as $k => $v) { unset($process[$key][$k]); if(is_array($v)) { $process[$key][stripslashes($k)] = $v; $process[] = &$process[$key][stripslashes($k)]; } else { $process[$key][stripslashes($k)] = stripslashes($v); } } } unset($process); }
Output for 5.4.0 - 7.1.0
Output for 4.3.2 - 5.3.29
Array ( [0] => Array ( ) [1] => Array ( [abe] => love ) [2] => Array ( ) [3] => Array ( ) )
Output for 4.3.0 - 4.3.1
Array ( [0] => Array ( [/in/6IabE] => ) [1] => Array ( [abe] => love ) [2] => Array ( ) [3] => Array ( [/in/6IabE] => ) )