3v4l.org

run code in 300+ PHP versions simultaneously
<?php $name = array('name1', 'name2'); $email = array('email1', 'email2'); function array_combine_values_assoc(array $keys, array $data = []) { if (func_num_args() > 2) { $data = array_slice(func_get_args(), 1); } return array_map(function ($key) use ($keys, $data) { return array_combine($keys, array_column($data, $key)); }, array_keys(current($data))); } var_dump(array_combine_values_assoc(['name', 'email'], $name, $email)); var_dump(array_combine_values_assoc(['name', 'email'], [$name, $email]));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FF7Mg
function name:  (null)
number of ops:  20
compiled vars:  !0 = $name, !1 = $email
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
   17     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'array_combine_values_assoc'
          4        SEND_VAL                                                 <array>
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        DO_FCALL                                      0  $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                                 
   18    10        INIT_FCALL                                               'var_dump'
         11        INIT_FCALL                                               'array_combine_values_assoc'
         12        SEND_VAL                                                 <array>
         13        INIT_ARRAY                                       ~6      !0
         14        ADD_ARRAY_ELEMENT                                ~6      !1
         15        SEND_VAL                                                 ~6
         16        DO_FCALL                                      0  $7      
         17        SEND_VAR                                                 $7
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Function array_combine_values_assoc:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/FF7Mg
function name:  array_combine_values_assoc
number of ops:  22
compiled vars:  !0 = $keys, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <array>
    8     2        FUNC_NUM_ARGS                                    ~2      
          3        IS_SMALLER                                               2, ~2
          4      > JMPZ                                                     ~3, ->7
    9     5    >   FUNC_GET_ARGS                                    ~4      1
          6        ASSIGN                                                   !1, ~4
   12     7    >   INIT_FCALL                                               'array_map'
          8        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FFF7Mg%3A12%240'
          9        BIND_LEXICAL                                             ~6, !0
         10        BIND_LEXICAL                                             ~6, !1
   14    11        SEND_VAL                                                 ~6
         12        INIT_FCALL                                               'array_keys'
         13        INIT_FCALL                                               'current'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $7      
         16        SEND_VAR                                                 $7
         17        DO_ICALL                                         $8      
         18        SEND_VAR                                                 $8
         19        DO_ICALL                                         $9      
         20      > RETURN                                                   $9
   15    21*     > RETURN                                                   null

End of function array_combine_values_assoc

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

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.79 ms | 1394 KiB | 27 Q