3v4l.org

run code in 300+ PHP versions simultaneously
<?php $full = [ 'Cars' => [ 'Volvo' => 0, 'Mercedes' => 0, 'BMW' => 0, 'Audi' => 0 ], 'Motorcycle' => [ 'Ducati' => 0, 'Honda' => 0, 'Suzuki' => 0, 'KTM' => 0 ] ]; $semi = [ 'Volvo' => 1, 'Audi' => 1 ]; foreach ($full as &$manufacturers) { foreach ($manufacturers as $m => &$count) { $count += $semi[$m] ?? 0; } } var_export($full);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 'Cars' => array ( 'Volvo' => 1, 'Mercedes' => 0, 'BMW' => 0, 'Audi' => 1, ), 'Motorcycle' => array ( 'Ducati' => 0, 'Honda' => 0, 'Suzuki' => 0, 'KTM' => 0, ), )

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:
27.06 ms | 406 KiB | 5 Q