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($arr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
2 jumps found. (Code = 126) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/Q9pKV
function name:  (null)
number of ops:  32
compiled vars:  !0 = $array1, !1 = $array2, !2 = $arr, !3 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   13     1        ASSIGN                                                   !1, <array>
   22     2        INIT_FCALL                                               'array_column'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 'name'
          5        SEND_VAL                                                 'uid'
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !1, $6
   23     8      > FE_RESET_RW                                      $8      !0, ->15
          9    > > FE_FETCH_RW                                              $8, !2, ->15
         10    >   FETCH_DIM_R                                      ~10     !2, 'uid'
         11        FETCH_DIM_R                                      ~11     !1, ~10
         12        ASSIGN_DIM                                               !2, 'uid'
         13        OP_DATA                                                  ~11
         14      > JMP                                                      ->9
         15    >   FE_FREE                                                  $8
   24    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                                 
   26    19        ASSIGN                                                   !2, <array>
   33    20        ECHO                                                     '%3Cpre%3E'
   34    21        ASSIGN                                                   !3, <array>
   35    22        INIT_FCALL                                               'array_walk'
         23        SEND_REF                                                 !2
         24        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FQ9pKV%3A35%240'
         25        BIND_LEXICAL                                             ~15, !3
         26        SEND_VAL                                                 ~15
         27        DO_ICALL                                                 
   39    28        INIT_FCALL                                               'print_r'
         29        SEND_VAR                                                 !2
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FQ9pKV%3A35%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Q9pKV
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $item, !1 = $key, !2 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
          3        INIT_FCALL                                               'array_merge'
          4        SEND_VAR                                                 !2
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7        ASSIGN                                                   !2, $3
          8      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FQ9pKV%3A35%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.38 ms | 1400 KiB | 23 Q