3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = get_magic_quotes_gpc(); $b = ini_get("magic_quotes_gpc"); var_dump($a); var_dump($b); echo "1) ".get_magic_quotes_gpc()." >> "; echo "2) ".ini_get("magic_quotes_gpc")." >> "; echo "1) ".get_magic_quotes_runtime()." >> "; echo "2) ".ini_get("magic_quotes_runtime")." >> "; @ini_set('magic_quotes_runtime', 1); echo "2) ".ini_get("magic_quotes_runtime")." >> "; $str = "'\""; $arr = array(); $arr[] = "string : ".$str; $arr[] = "addslashes : ".addslashes($str); $arr[] = "stripslashes : ".stripslashes($str); $arr[] = "htmlentities : ".htmlentities($str); $arr[] = "testing : '".$str."'"; print_r($arr);
Output for 5.4.0 - 7.1.0
bool(false) bool(false) 1) >> 2) >> 1) >> 2) >> 2) >> Array ( [0] => string : '" [1] => addslashes : \'\" [2] => stripslashes : '" [3] => htmlentities : '&quot; [4] => testing : ''"' )
Output for 4.3.0 - 5.3.29
int(1) string(1) "1" 1) 1 >> 2) 1 >> 1) 0 >> 2) 0 >> 2) 1 >> Array ( [0] => string : '" [1] => addslashes : \'\" [2] => stripslashes : '" [3] => htmlentities : '&quot; [4] => testing : ''"' )