3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ 'section-name' => ['sec1'], 'item-name' => ['1','2'], 'item-price' => ['1'], 'item-desc' => ['1','2','3'] ]; // take this out. it doesn't belong. $section = array_shift($data); $items = array_map( function($name, $price, $desc) { return ['name'=>$name, 'price'=>$price, 'desc'=>$desc]; }, ...array_values($data) ); var_dump($items);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EHWTr
function name:  (null)
number of ops:  19
compiled vars:  !0 = $data, !1 = $section, !2 = $items
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   10     1        INIT_FCALL                                               'array_shift'
          2        SEND_REF                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
   12     5        INIT_FCALL                                               'array_map'
   13     6        DECLARE_LAMBDA_FUNCTION                          ~6      [0]
   15     7        SEND_VAL                                                 ~6
   16     8        INIT_FCALL                                               'array_values'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $7      
         11        SEND_UNPACK                                              $7
         12        CHECK_UNDEF_ARGS                                         
   12    13        DO_ICALL                                         $8      
         14        ASSIGN                                                   !2, $8
   19    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                                 
         18      > 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/EHWTr
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $name, !1 = $price, !2 = $desc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   14     3        INIT_ARRAY                                       ~3      !0, 'name'
          4        ADD_ARRAY_ELEMENT                                ~3      !1, 'price'
          5        ADD_ARRAY_ELEMENT                                ~3      !2, 'desc'
          6      > RETURN                                                   ~3
   15     7*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
288.95 ms | 1014 KiB | 17 Q