3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class obj implements Serializable { private $data; public function __construct() { $this->data = "My private data"; } public function serialize() { return serialize($this); } public function unserialize($data) { $this = unserialize($data); } public function getData() { return $this->data; } } $obj = new obj; $ser = serialize($obj); var_dump($ser); $newobj = unserialize($ser); var_dump($newobj->getData());
Output for 5.3.0 - 5.4.23
Fatal error: Cannot re-assign $this in /in/07Q89 on line 12
Process exited with code 255.