3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class obj { var $y; function __wakeup() { (int)$this->y; } } var_dump(unserialize('a:2:{i:0;C:3:"GMP":17:{s:4:"1234";a:0:{}}i:1;O:3:"obj":1:{s:1:"y";R:2;}}'));
based on F03U2
Output for 5.6.28, 7.0.20 - 7.2.0
array(2) { [0]=> &object(GMP)#1 (1) { ["num"]=> string(4) "1234" } [1]=> object(obj)#2 (1) { ["y"]=> &object(GMP)#1 (1) { ["num"]=> string(4) "1234" } } }
Output for 5.4.0 - 5.6.26, 7.0.0 - 7.0.11
Warning: Class __PHP_Incomplete_Class has no unserializer in /in/uDbQl on line 10 Notice: Object of class __PHP_Incomplete_Class could not be converted to int in /in/uDbQl on line 6 array(2) { [0]=> &object(__PHP_Incomplete_Class)#1 (1) { ["__PHP_Incomplete_Class_Name"]=> string(3) "GMP" } [1]=> object(obj)#2 (1) { ["y"]=> &object(__PHP_Incomplete_Class)#1 (1) { ["__PHP_Incomplete_Class_Name"]=> string(3) "GMP" } } }