3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class obj { private $one; private $two; private $three; private $four; public function __construct() { $this->one = "1"; $this->two = "2"; $this->three = "3"; $this->four = "4"; } public function getData() { return $this->dataa; } } $obj = new obj; $ser = serialize($obj); var_dump($ser); $newobj = unserialize($ser); var_dump($newobj->getData()); ?>
Output for 5.2.6 - 7.1.0
string(110) "O:3:"obj":4:{s:8:"objone";s:1:"1";s:8:"objtwo";s:1:"2";s:10:"objthree";s:1:"3";s:9:"objfour";s:1:"4";}" Notice: Undefined property: obj::$dataa in /in/3O0EF on line 16 NULL
Output for 5.0.0 - 5.2.5
string(110) "O:3:"obj":4:{s:8:"objone";s:1:"1";s:8:"objtwo";s:1:"2";s:10:"objthree";s:1:"3";s:9:"objfour";s:1:"4";}" Notice: Undefined property: obj::$dataa in /in/3O0EF on line 16 NULL
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/3O0EF on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/3O0EF on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/3O0EF on line 4
Process exited with code 255.