3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $y = 'b'; public $foo; public $bar; public $x = "A"; } class B { public $baz; function __wakeup() { echo "Within wakeup\n"; var_dump($this->baz); echo "Done wakeup\n"; } } $a = new A(); $b = new B(); $a->foo = $b; $a->bar = "something"; $b->baz = $a; var_dump($a); $unserialized = unserialize(serialize([$a])); echo "After unserialize\n"; var_dump($unserialized);
Output for git.master, git.master_jit, rfc.property-hooks
object(A)#1 (4) { ["y"]=> string(1) "b" ["foo"]=> object(B)#2 (1) { ["baz"]=> *RECURSION* } ["bar"]=> string(9) "something" ["x"]=> string(1) "A" } Within wakeup object(A)#3 (4) { ["y"]=> string(1) "b" ["foo"]=> object(B)#4 (1) { ["baz"]=> *RECURSION* } ["bar"]=> string(9) "something" ["x"]=> string(1) "A" } Done wakeup After unserialize array(1) { [0]=> object(A)#3 (4) { ["y"]=> string(1) "b" ["foo"]=> object(B)#4 (1) { ["baz"]=> *RECURSION* } ["bar"]=> string(9) "something" ["x"]=> string(1) "A" } }

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:
76.4 ms | 407 KiB | 5 Q