3v4l.org

run code in 300+ PHP versions simultaneously
<?php class child implements Serializable { public function serialize() { return null; } public function unserialize($serialized) { } } class test { private $elems = []; public function add($something) { $this->elems[] = $something; } } $child = new child(); $t = new test(); $t->add(1); $t->add('test'); var_dump(unserialize(serialize($t))); $t->add($child); var_dump(unserialize(serialize($t))); $t->add($child); var_dump(unserialize(serialize($t)));
Output for git.master_jit, git.master, rfc.property-hooks
Deprecated: child 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/cTPe9 on line 3 object(test)#3 (1) { ["elems":"test":private]=> array(2) { [0]=> int(1) [1]=> string(4) "test" } } object(test)#3 (1) { ["elems":"test":private]=> array(3) { [0]=> int(1) [1]=> string(4) "test" [2]=> NULL } } object(test)#3 (1) { ["elems":"test":private]=> array(4) { [0]=> int(1) [1]=> string(4) "test" [2]=> NULL [3]=> NULL } }

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