3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = [ [ 'id' => 1, 'total' => 100, ], [ 'id' => 2, 'total' => 200, ], [ 'id' => 1, 'total' => 300, ], ]; $array2 = [ [ 'id' => 1, 'daily' => 10, ], [ 'id' => 2, 'daily' => 20, ], ]; $result = array(); foreach($array1 as $key => $value){ $result[] = $array1[$key] + $array2[$key]; } print_r($result); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined array key 2 in /in/vbCGo on line 32 Fatal error: Uncaught TypeError: Unsupported operand types: array + null in /in/vbCGo:32 Stack trace: #0 {main} thrown in /in/vbCGo on line 32
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:
53.66 ms | 401 KiB | 8 Q