3v4l.org

run code in 300+ PHP versions simultaneously
<?php $originalArray = [ ['A', 'B', 'C'], [1,2,3], [4,5,6], ]; $headers = array_shift($myArray); array_walk( $myArray, function($row) use ($headers) { $row = array_combine($headers, $row); } ); var_dump($myArray);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/79iGn
function name:  (null)
number of ops:  15
compiled vars:  !0 = $originalArray, !1 = $headers, !2 = $myArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        INIT_FCALL                                               'array_shift'
          2        SEND_REF                                                 !2
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
   10     5        INIT_FCALL                                               'array_walk'
   11     6        SEND_REF                                                 !2
   12     7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F79iGn%3A12%240'
          8        BIND_LEXICAL                                             ~6, !1
   14     9        SEND_VAL                                                 ~6
         10        DO_ICALL                                                 
   17    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F79iGn%3A12%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/79iGn
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $row, !1 = $headers
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   13     2        INIT_FCALL                                               'array_combine'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        ASSIGN                                                   !0, $2
   14     7      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F79iGn%3A12%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.85 ms | 1395 KiB | 21 Q