3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C {} $c = serialize(new C); var_dump(unserialize($c, ["allowed_classes" => 42])); var_dump(unserialize($c, ["allowed_classes" => 0]));
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Uncaught TypeError: unserialize(): Option "allowed_classes" must be of type array|bool, int given in /in/Rt99r:7 Stack trace: #0 /in/Rt99r(7): unserialize('O:1:"C":0:{}', Array) #1 {main} thrown in /in/Rt99r on line 7
Process exited with code 255.
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
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.4.45, 5.5.24 - 5.5.35, 5.6.8 - 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)

preferences:
189.87 ms | 402 KiB | 265 Q