3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $data = array("Foo"); public function __sleep() { return array("data"); } } class Bar implements Serializable{ private $data = array("Bar"); public function serialize() { return serialize($data); } public function unserialize($data) { $this->data = unserialize($data); } } $foo = new Foo; $bar = new Bar; var_dump(serialize($foo)); var_dump(serialize($bar));
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Bar 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/uf1cb on line 10 string(50) "O:3:"Foo":1:{s:9:"Foodata";a:1:{i:0;s:3:"Foo";}}" Warning: Undefined variable $data in /in/uf1cb on line 13 string(16) "C:3:"Bar":2:{N;}"

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:
36.94 ms | 402 KiB | 8 Q