3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str1 = "type1|type2"; $str2 = "val1|val2"; $columnNames = ['type', 'val']; var_export( array_map( fn(...$col) => array_combine($columnNames, $col), explode('|', $str1), explode('|', $str2) ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TIaq7
function name:  (null)
number of ops:  22
compiled vars:  !0 = $str1, !1 = $str2, !2 = $columnNames
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'type1%7Ctype2'
    4     1        ASSIGN                                                   !1, 'val1%7Cval2'
    6     2        ASSIGN                                                   !2, <array>
    8     3        INIT_FCALL                                               'var_export'
    9     4        INIT_FCALL                                               'array_map'
   10     5        DECLARE_LAMBDA_FUNCTION                          ~6      [0]
          6        BIND_LEXICAL                                             ~6, !2
          7        SEND_VAL                                                 ~6
   11     8        INIT_FCALL                                               'explode'
          9        SEND_VAL                                                 '%7C'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $7      
         12        SEND_VAR                                                 $7
   12    13        INIT_FCALL                                               'explode'
         14        SEND_VAL                                                 '%7C'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                         $8      
         17        SEND_VAR                                                 $8
    9    18        DO_ICALL                                         $9      
   12    19        SEND_VAR                                                 $9
    8    20        DO_ICALL                                                 
   14    21      > 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/TIaq7
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $col, !1 = $columnNames
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV_VARIADIC                                    !0      
          1        BIND_STATIC                                              !1
          2        INIT_FCALL                                               'array_combine'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
          7*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.85 ms | 1014 KiB | 17 Q