3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = array ( "group_name_1" => "audi", "group_locations_1" => "tokyo,barcelona,paris", "group_quantities_at_locations_1" => "1,2,7", "group_name_2" => "ford", "group_locations_2" => "london,prag", "group_quantities_at_locations_2" => "3,6" ); $result = []; array_walk(array_chunk($input,3),function($v)use(&$result){ $result[$v[0]] = array_combine(explode(",",$v[1]),explode(",",$v[2])); }); print_r($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sRd1f
function name:  (null)
number of ops:  16
compiled vars:  !0 = $input, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
   13     1        ASSIGN                                                   !1, <array>
   14     2        INIT_FCALL                                               'array_walk'
          3        INIT_FCALL                                               'array_chunk'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 3
          6        DO_ICALL                                         $4      
          7        SEND_VAR_NO_REF                               0          $4
          8        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FsRd1f%3A14%240'
          9        BIND_LEXICAL                                             ~5, !1
   16    10        SEND_VAL                                                 ~5
         11        DO_ICALL                                                 
   18    12        INIT_FCALL                                               'print_r'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FsRd1f%3A14%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sRd1f
function name:  {closure}
number of ops:  20
compiled vars:  !0 = $v, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   15     2        FETCH_DIM_R                                      ~2      !0, 0
          3        INIT_FCALL                                               'array_combine'
          4        INIT_FCALL                                               'explode'
          5        SEND_VAL                                                 '%2C'
          6        FETCH_DIM_R                                      ~4      !0, 1
          7        SEND_VAL                                                 ~4
          8        DO_ICALL                                         $5      
          9        SEND_VAR                                                 $5
         10        INIT_FCALL                                               'explode'
         11        SEND_VAL                                                 '%2C'
         12        FETCH_DIM_R                                      ~6      !0, 2
         13        SEND_VAL                                                 ~6
         14        DO_ICALL                                         $7      
         15        SEND_VAR                                                 $7
         16        DO_ICALL                                         $8      
         17        ASSIGN_DIM                                               !1, ~2
         18        OP_DATA                                                  $8
   16    19      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FsRd1f%3A14%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
185.27 ms | 1396 KiB | 23 Q