3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class C {} $c = serialize(new C); var_dump(unserialize($c, ["allowed_classes" => 42])); var_dump(unserialize($c, ["allowed_classes" => 0]));
based on 3HGAJ
Output for 7.1.0 - 7.2.0
Warning: unserialize(): allowed_classes option should be array or boolean in /in/Rt99r on line 7 bool(false) Warning: unserialize(): allowed_classes option should be array or boolean in /in/Rt99r on line 8 bool(false)
Output for 7.0.0 - 7.0.20
object(C)#1 (0) { } object(__PHP_Incomplete_Class)#1 (1) { ["__PHP_Incomplete_Class_Name"]=> string(1) "C" }
Output for 5.4.2 - 5.6.28
Warning: unserialize() expects exactly 1 parameter, 2 given in /in/Rt99r on line 7 bool(false) Warning: unserialize() expects exactly 1 parameter, 2 given in /in/Rt99r on line 8 bool(false)
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/Rt99r on line 7
Process exited with code 255.