3v4l.org

run code in 300+ PHP versions simultaneously
<?php class testA implements \Serializable { private $b = 123; public $a = 4; public function test() { $this->b = 1234; } public function serialize() { return serialize(array("a" => $this->a, "b" => $this->b)); } public function unserialize($str) { $ar = unserialize($str); $this->a = $ar['a']; $this->b = $ar['b']; } } $className = "testA"; $object = unserialize( sprintf('O:%d:"%s":0:{}', strlen($className), $className) ); var_dump($object);
Output for git.master, git.master_jit
Deprecated: testA implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /in/SKShm on line 3 Warning: Erroneous data format for unserializing 'testA' in /in/SKShm on line 29 Notice: unserialize(): Error at offset 15 of 16 bytes in /in/SKShm on line 29 bool(false)
Output for rfc.property-hooks
Deprecated: testA implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /in/SKShm on line 3 Warning: Erroneous data format for unserializing 'testA' in /in/SKShm on line 29 Warning: unserialize(): Error at offset 15 of 16 bytes in /in/SKShm on line 29 bool(false)

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
46.72 ms | 402 KiB | 8 Q