3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected $a; public function __construct($a) { $this->a = $a; } public function getA() { return $this->a; } } class B { protected $name; public function __construct($name) { $this->name = $name; } } $b = new B('test'); $a = new A($b); $a1 = new A($b); $s = serialize( array( // Acl:serialize (line 260) [ // classFieldAces 'fieldOne' => [$a], 'fieldTwo' => [$a1], ] ) ); var_dump($s); $uns = unserialize($s); var_dump($uns[0]['fieldOne'][0], $uns[0]['fieldTwo'][0]);
Output for git.master, git.master_jit, rfc.property-hooks
string(153) "a:1:{i:0;a:2:{s:8:"fieldOne";a:1:{i:0;O:1:"A":1:{s:4:"*a";O:1:"B":1:{s:7:"*name";s:4:"test";}}}s:8:"fieldTwo";a:1:{i:0;O:1:"A":1:{s:4:"*a";r:5;}}}}" object(A)#4 (1) { ["a":protected]=> object(B)#5 (1) { ["name":protected]=> string(4) "test" } } object(A)#6 (1) { ["a":protected]=> object(B)#5 (1) { ["name":protected]=> string(4) "test" } }

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