3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arrays = [ [ "Phone", "Sum", "Name", "Something else" ], [ "+1 555123456", "50.00", "John doe", "100.50" ], [ "911", "20.12", "Eli the Computer Guy", "99.99" ] ]; $headers = array_shift($arrays); $result = array_map(function($x) use ($headers){ return array_combine($headers, $x); }, $arrays); print_r($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BhKif
function name:  (null)
number of ops:  16
compiled vars:  !0 = $arrays, !1 = $headers, !2 = $result
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   24     1        INIT_FCALL                                                   'array_shift'
          2        SEND_REF                                                     !0
          3        DO_ICALL                                             $4      
          4        ASSIGN                                                       !1, $4
   25     5        INIT_FCALL                                                   'array_map'
          6        DECLARE_LAMBDA_FUNCTION                              ~6      [0]
          7        BIND_LEXICAL                                                 ~6, !1
   27     8        SEND_VAL                                                     ~6
          9        SEND_VAR                                                     !0
   25    10        DO_ICALL                                             $7      
         11        ASSIGN                                                       !2, $7
   29    12        INIT_FCALL                                                   'print_r'
         13        SEND_VAR                                                     !2
         14        DO_ICALL                                                     
         15      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BhKif
function name:  {closure:/in/BhKif:25}
number of ops:  8
compiled vars:  !0 = $x, !1 = $headers
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   25     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
   26     2        INIT_FCALL                                                   'array_combine'
          3        SEND_VAR                                                     !1
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                             $2      
          6      > RETURN                                                       $2
   27     7*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.46 ms | 2291 KiB | 17 Q