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 __construct($array) { foreach($array as $key => $val) { $array[$key] = $val; var_dump($arry); } } } $a = new ryat($GLOBALS = array('ryat'=>'ryat')); $str = 'O:4:"ryat":0:{}'; echo $ryat; echo(serialize($a));
Output for 5.0.4 - 5.6.21, hhvm-3.12.0, 7.0.0 - 7.1.0
Notice: Undefined variable: arry in /in/kgEES on line 21 NULL O:4:"ryat":0:{}
Output for hhvm-3.10.0
Notice: Undefined variable: arry in /in/kgEES on line -1 NULL O:4:"ryat":0:{}
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: arry in /in/kgEES on line 21 NULL O:4:"ryat":0:{}
Output for 4.3.0 - 4.4.9
O:4:"ryat":0:{}