3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class obj { var $prop; function __wakeup() { $this->prop = 'prop'; } } $x = 'a:4:{i:0;O:8:"stdClass":1:{i:0;a:1:{i:0;i:1;}}i:1;O:3:"obj":1:{s:4:"prop";R:2;}i:2;N;i:3;R:3;}'; $y = unserialize($x); var_dump($y);
based on hkKET
Output for 5.4.39 - 5.4.45, 5.5.23 - 5.5.38, 5.6.7 - 7.2.0
array(4) { [0]=> &string(4) "prop" [1]=> object(obj)#2 (1) { ["prop"]=> &string(4) "prop" } [2]=> NULL [3]=> array(1) { [0]=> int(1) } }
Output for 5.4.9 - 5.4.38, 5.5.0 - 5.5.22, 5.6.0 - 5.6.6
array(4) { [0]=> &string(4) "prop" [1]=> object(obj)#2 (1) { ["prop"]=> &string(4) "prop" } [2]=> NULL [3]=> &NULL }
Output for 5.4.0 - 5.4.8
array(4) { [0]=> &string(4) "prop" [1]=> object(obj)#2 (1) { ["prop"]=> &string(4) "prop" } [2]=> NULL [3]=> &array(49) {
Process exited with code 139.