3v4l.org

run code in 300+ PHP versions simultaneously
<?php class obj { var $y; function __wakeup() { $this->y = 1; } } $x = 'a:4:{i:0;i:1;i:1;O:9:"exception":1:{s:17:"'."\0".'Exception'."\0".'string";r:2;}i:2;O:3:"obj":1:{s:1:"y";R:3;}i:3;R:4;}'; $x = unserialize($x); for ($i = 0; $i < 5; $i++) { $v[$i] = 'hi'.$i; } var_dump($x);
Output for 8.3.0 - 8.3.7
Warning: unserialize(): Error at offset 65 of 105 bytes in /in/ahDr2 on line 12 bool(false)
Output for 7.3.16 - 7.3.31, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
Notice: unserialize(): Error at offset 65 of 105 bytes in /in/ahDr2 on line 12 bool(false)
Output for 7.3.32 - 7.3.33
bool(false)
Output for 7.0.20, 7.1.5 - 7.1.20, 7.2.0 - 7.2.33
array(4) { [0]=> int(1) [1]=> &int(1) [2]=> object(obj)#2 (1) { ["y"]=> &int(1) } [3]=> int(1) }
Output for 7.0.0 - 7.0.6, 7.1.0
array(3) { [0]=> int(1) [1]=> &int(1) [2]=> object(obj)#2 (1) { ["y"]=> &int(1) } }
Output for 5.4.20 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
array(4) { [0]=> int(1) [1]=> &int(1) [2]=> object(obj)#2 (1) { ["y"]=> &int(1) } [3]=> NULL }
Output for 5.4.1 - 5.4.13, 5.4.15 - 5.4.19
array(4) { [0]=> int(1) [1]=> &int(1) [2]=> object(obj)#2 (1) { ["y"]=> &int(1) } [3]=> &UNKNOWN:0 }
Process exited with code 139.
Output for 5.4.14
array(4) { [0]=> int(1) [1]=> &int(1) [2]=> object(obj)#2 (1) { ["y"]=> &int(1) } [3]=> &bool(true) }
Process exited with code 139.

preferences:
186.13 ms | 401 KiB | 228 Q