3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { protected $a = 10; protected $c;} class b { protected $b; public function setA($a){$this->b = $a;return $this;}} var_dump(unserialize(serialize((new b)->setA(new a)), true));
Output for 8.3.0 - 8.3.7
Fatal error: Uncaught TypeError: unserialize(): Argument #2 ($options) must be of type array, true given in /in/hcj5A:7 Stack trace: #0 /in/hcj5A(7): unserialize('O:1:"b":1:{s:4:...', true) #1 {main} thrown in /in/hcj5A on line 7
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19
Fatal error: Uncaught TypeError: unserialize(): Argument #2 ($options) must be of type array, bool given in /in/hcj5A:7 Stack trace: #0 /in/hcj5A(7): unserialize('O:1:"b":1:{s:4:...', true) #1 {main} thrown in /in/hcj5A on line 7
Process exited with code 255.
Output for 7.3.16 - 7.3.33, 7.4.0 - 7.4.33
Warning: unserialize() expects parameter 2 to be array, bool given in /in/hcj5A on line 7 bool(false)
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33
Warning: unserialize() expects parameter 2 to be array, boolean given in /in/hcj5A on line 7 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/hcj5A on line 7 bool(false)

preferences:
132.77 ms | 402 KiB | 185 Q