3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [ '0' => ['name'=>'Apple', 'id' => 1], '1' => ['name'=>'Banana', 'id' => 2], '2' => ['name' => 'orange', 'id' => 3], ]; $b = [ '0' => ['price'=> 20, 'a_id' => 2], '1' => ['price'=> 10, 'a_id' => 3], '3' => ['price'=> 30, 'a_id' => 1], ]; $result = array_column($a, null, 'id'); foreach ($b as ['a_id' => $a_id, 'price' => $result[$a_id]['price']]); var_export(array_values($result));
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 'name' => 'Apple', 'id' => 1, 'price' => 30, ), 1 => array ( 'name' => 'Banana', 'id' => 2, 'price' => 20, ), 2 => array ( 'name' => 'orange', 'id' => 3, 'price' => 10, ), )

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