3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myobject extends ArrayObject { public function &offsetGet($key) { $var = parent::offsetGet($key); var_dump($var); return $var; } } $obj1 = new myobject(array(array(1,2,3), 1)); var_dump($obj1); unset($obj1[0][0]); var_dump($obj1);
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Return type of & myobject::offsetGet($key) should either be compatible with ArrayObject::offsetGet(mixed $key): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/SS4jP on line 3 object(myobject)#1 (1) { ["storage":"ArrayObject":private]=> array(2) { [0]=> array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } [1]=> int(1) } } array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } object(myobject)#1 (1) { ["storage":"ArrayObject":private]=> array(2) { [0]=> array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } [1]=> int(1) } }

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:
43.3 ms | 403 KiB | 8 Q