3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo implements Serializable { public $title; public $parent; public function jsonSerialize() { return [ 'title' => $this->title, 'parent' => $this->parent, ]; } } $f1 = new Foo(); $f1->title = 'Foo'; $f2 = new Foo(); $f2->title = 'Bar'; $f2->parent = $f1; echo json_encode($f2);
Output for git.master, git.master_jit, 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/7QEYO on line 3 Fatal error: Class Foo contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Serializable::serialize, Serializable::unserialize) in /in/7QEYO on line 3
Process exited with code 255.

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