3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function my_unserialize($data) { $array = unserialize($data); if(!is_array($array)) { $array = array(); } return $array; } $ryat = ''; class ryat { function a($array) { foreach($array as $key => $val) { $array[$key] = $val; } } } $a = new ryat(); $a = $a->a($GLOBALS['ryat']); $str = 'O:4:"ryat":0:{}'; echo $ryat; echo(serialize($a));
Output for 4.3.0 - 4.3.10, 4.4.0 - 7.2.0
Warning: Invalid argument supplied for foreach() in /in/KWbJb on line 19 N;
Output for 4.3.11
N;