3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test2 { public $foo = 'test'; } class test { private $arr; public function __construct() { $this->arr[0] = new test2(); $this->arr[1] = new test2(); } public function getArr() { return $this->arr; } } $t = new test(); var_dump($t->getArr()); $a = $t->getArr(); $a[0]->foo = 'bleh'; var_dump($t->getArr()); ?>
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { [0]=> object(test2)#2 (1) { ["foo"]=> string(4) "test" } [1]=> object(test2)#3 (1) { ["foo"]=> string(4) "test" } } array(2) { [0]=> object(test2)#2 (1) { ["foo"]=> string(4) "bleh" } [1]=> object(test2)#3 (1) { ["foo"]=> 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:
56 ms | 402 KiB | 8 Q