3v4l.org

run code in 150+ 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 - 5.6.21, 7.0.0 - 7.1.0
Warning: Invalid argument supplied for foreach() in /in/KWbJb on line 19 N;
Output for hhvm-3.12.0
Warning: Invalid argument supplied for foreach() in /in/KWbJb on line 21 N;
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.11
N;