3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $a = "a"; protected $b = "b"; public $c = "c"; } class B extends A implements Serializable { public function serialize() { $that = $this; return serialize($that); } public function unserialize($serialized) { } private $a = "a"; protected $b = "b"; public $c = "c"; } var_dump(json_encode(new A())); var_dump(json_encode(new B()));
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: B 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/ahPIq on line 9 string(9) "{"c":"c"}" string(9) "{"c":"c"}"

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