3v4l.org

run code in 300+ PHP versions simultaneously
<?php class c { public $prop; function __wakeup() { $this->prop = 'awake'; } } $c = new c; $c->prop = new stdclass; $a = [$c]; $a[] =& $c->prop; $s = serialize($a); var_dump($s); var_dump($a); $a2 = unserialize($s); var_dump($a2); $a2[0] = 'ref?'; var_dump($a2);
Output for git.master, git.master_jit, rfc.property-hooks
string(60) "a:2:{i:0;O:1:"c":1:{s:4:"prop";O:8:"stdClass":0:{}}i:1;R:3;}" array(2) { [0]=> object(c)#1 (1) { ["prop"]=> &object(stdClass)#2 (0) { } } [1]=> &object(stdClass)#2 (0) { } } array(2) { [0]=> object(c)#3 (1) { ["prop"]=> &string(5) "awake" } [1]=> &string(5) "awake" } array(2) { [0]=> string(4) "ref?" [1]=> string(5) "awake" }

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