3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 =[ ["id"=> "1", "uid"=>'123', "status"=>'0'], ["id"=> "2", "uid"=>'321', "status"=>'1'] ]; $array2 =[ ["uid"=> "123", "name"=>'张三'], ["uid"=> "321", "name"=>'李四'] ]; $array2 = array_column($array2, 'name', 'uid'); foreach($array1 as &$arr) $arr['uid'] = $array2[$arr['uid']]; var_dump($array1); $arr = array( '0'=>array('1','2'), '1'=>array('2','3'), '2'=>array('3','4'), '3'=>array('4','5'), '4'=>array('5','6'), ); echo '<pre>'; $res = array(); array_walk($arr, function($item, $key) use (&$res) {$res = array_merge($res, $item);}); print_r($res);
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { [0]=> array(3) { ["id"]=> string(1) "1" ["uid"]=> string(6) "张三" ["status"]=> string(1) "0" } [1]=> &array(3) { ["id"]=> string(1) "2" ["uid"]=> string(6) "李四" ["status"]=> string(1) "1" } } <pre>Array ( [0] => 1 [1] => 2 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 4 [7] => 5 [8] => 5 [9] => 6 )

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:
47.83 ms | 402 KiB | 8 Q