3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $bar = array('x' => array('a' => 'x1', 'b' => 'x2'), 'y' => array('a' => 'y1', 'b' => 'y2')); public function test() { foreach ($bar as $b) { $b['a'] = 'hello'; } } } $foo = new Foo(); $foo->test(); var_dump($foo->bar);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $bar in /in/Kg3ab on line 5 Warning: foreach() argument must be of type array|object, null given in /in/Kg3ab on line 5 array(2) { ["x"]=> array(2) { ["a"]=> string(2) "x1" ["b"]=> string(2) "x2" } ["y"]=> array(2) { ["a"]=> string(2) "y1" ["b"]=> string(2) "y2" } }

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:
61.83 ms | 401 KiB | 8 Q