3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = array ( 0 => array ( 'id' => 4, 'day_of_week' => 'sun', 'description' => 'suntestdescription', 'status' => 0, 'date' => '2019-01-11' ), 1 => array ( 'id' => 5, 'day_of_week' => 'mon', 'description' => 'montestdescription', 'status' => 0, 'date' => '2019-01-11' ) ); $array2 = array ( 0 => array ( 'id' => 1, 'day_of_week' => 'mon', 'description' => 'monupdatedtestdescription', 'status' => 1, 'date' => '2019-01-11' ) ); $array1 = array_map(function ($v) use ($array2) { if (($k = array_search($v['day_of_week'], array_column($array2, 'day_of_week'))) !== false && $array2[$k]['status'] == 1) return $array2[$k]; else return $v; }, $array1); print_r($array1);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [id] => 4 [day_of_week] => sun [description] => suntestdescription [status] => 0 [date] => 2019-01-11 ) [1] => Array ( [id] => 1 [day_of_week] => mon [description] => monupdatedtestdescription [status] => 1 [date] => 2019-01-11 ) )

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