3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a1 = array('car1' => array('color' => 'black', 'weight'=> '100'), 'car2' => array('color' => 'white', 'weight'=> '200')); foreach($a1 as &$car){ $car['type'] = 'легковая'; } var_dump($a1); foreach($a1 as $key => $car){ var_dump( $key, $car); }
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { ["car1"]=> array(3) { ["color"]=> string(5) "black" ["weight"]=> string(3) "100" ["type"]=> string(16) "легковая" } ["car2"]=> &array(3) { ["color"]=> string(5) "white" ["weight"]=> string(3) "200" ["type"]=> string(16) "легковая" } } string(4) "car1" array(3) { ["color"]=> string(5) "black" ["weight"]=> string(3) "100" ["type"]=> string(16) "легковая" } string(4) "car2" array(3) { ["color"]=> string(5) "black" ["weight"]=> string(3) "100" ["type"]=> string(16) "легковая" }

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