3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = array(); $array1 = array(array("a" => 30, "b" => 5), array("a" => 30, "b" => 5), array("a" => 30, "b" => 0), array("a" => 5, "b" => 5), array("a" => 15, "b" => 0)); $array2 = array(array("a" => 207, "b" => 225), array("a" => 35, "b" => 0), array("a" => 35, "b" => 90), array("a" => 80, "b" => 140), array("a" => 40, "b" => 35)); $array3 = Array(); reset($array1); while (list($key) = each($array1)) { reset($array1[$key]); while (list($k,$v) = each($array1[$key])) { $array3[$key][$k] = $v + $array2[$key][$k]; } } print_r($array3);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function each() in /in/dIPa8:9 Stack trace: #0 {main} thrown in /in/dIPa8 on line 9
Process exited with code 255.

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