3v4l.org

run code in 500+ PHP versions simultaneously
<?php //class Foo class Foo implements \Serializable { public $a = 'lorem'; public function __wakeup() { fprintf(STDOUT, "in %s\n", __METHOD__); } public function serialize() { fprintf(STDOUT, "in %s\n", __METHOD__); return serialize([ $this->a, ]); } public function unserialize($serialized) { fprintf(STDOUT, "in %s\n", __METHOD__); list( $this->a, ) = unserialize($serialized); } } //$foo = new Foo(); //var_dump(serialize($foo)); //exit; $serialised = 'O:3:"Foo":1:{s:1:"a";s:5:"lorem";}'; //$serialised = 'C:3:"Foo":22:{a:1:{i:0;s:5:"lorem";}}'; $foo = unserialize($serialised); var_dump($foo);
Output for git.master, git.master_jit
Deprecated: Foo 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/SHaCP on line 4 Warning: Erroneous data format for unserializing 'Foo' in /in/SHaCP on line 39 Notice: unserialize(): Error at offset 13 of 34 bytes in /in/SHaCP on line 39 bool(false)
Output for rfc.property-hooks
Deprecated: Foo 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/SHaCP on line 4 Warning: Erroneous data format for unserializing 'Foo' in /in/SHaCP on line 39 Warning: unserialize(): Error at offset 13 of 34 bytes in /in/SHaCP on line 39 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:
42.47 ms | 1460 KiB | 4 Q