3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { } class b { } $as = serialize(new a); $as = serialize(new b); var_dump(unserialize($as, array('allowed_asss' => 'a') )); var_dump(unserialize($bs, array('allowed_asss' => 'a') ));
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
object(b)#1 (0) { } Warning: Undefined variable $bs in /in/AR4sr on line 16 Deprecated: unserialize(): Passing null to parameter #1 ($data) of type string is deprecated in /in/AR4sr on line 16 bool(false)
Output for 8.0.0 - 8.0.30
object(b)#1 (0) { } Warning: Undefined variable $bs in /in/AR4sr on line 16 bool(false)
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
object(b)#1 (0) { } Notice: Undefined variable: bs in /in/AR4sr on line 16 bool(false)
Output for 7.3.32 - 7.3.33
object(b)#1 (0) { } bool(false)
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Warning: unserialize() expects exactly 1 parameter, 2 given in /in/AR4sr on line 15 bool(false) Notice: Undefined variable: bs in /in/AR4sr on line 16 Warning: unserialize() expects exactly 1 parameter, 2 given in /in/AR4sr on line 16 bool(false)

preferences:
191.83 ms | 402 KiB | 229 Q