3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function __sleep() { return []; } public function __wakeup() { echo 'Called ' . __METHOD__ . PHP_EOL; } } class Bar implements \Serializable { private $foo; public function __construct(Foo $foo) { $this->foo = $foo; } public function serialize() { return serialize($this->foo); } public function unserialize($serialized) { echo 'unserialize Foo' . PHP_EOL; $this->foo = unserialize($serialized); echo 'end unserialize Foo' . PHP_EOL; } } $foo = new Foo(); $bar = new Bar($foo); $barStr = serialize($bar); $newBar = unserialize($barStr);
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/MlbuO on line 15 unserialize Foo end unserialize Foo Called Foo::__wakeup

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:
63.9 ms | 401 KiB | 8 Q