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($this->data); } public function unserialize($data) { $this->data = unserialize($data); } public function __sleep() { echo "this won't get called"; exit; } } $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/B57Kk on line 10 string(50) "O:3:"Foo":1:{s:9:"Foodata";a:1:{i:0;s:3:"Foo";}}" string(35) "C:3:"Bar":20:{a:1:{i:0;s:3:"Bar";}}"

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