3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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));
based on ON54R
Output for 7.0.0 - 7.2.0
Warning: unserialize() expects parameter 2 to be array, boolean given in /in/hcj5A on line 7 bool(false)
Output for 5.4.10 - 5.6.28
Warning: unserialize() expects exactly 1 parameter, 2 given in /in/hcj5A on line 7 bool(false)
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/hcj5A on line 7
Process exited with code 255.