3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = [ 'SELECT0' => 'orange', 'INPUT0' => '100', 'SELECT1' => 'bannana', 'INPUT1' => '200', 'SELECT2' => 'apple', 'INPUT2' => '300' ]; $result = []; foreach (array_chunk(array_values($arr), 2) as [$newKey, $result[$newKey]]); var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 18
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 18
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/BOVYL
function name:  (null)
number of ops:  23
compiled vars:  !0 = $arr, !1 = $result, !2 = $newKey
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   12     1        ASSIGN                                                       !1, <array>
   13     2        INIT_FCALL                                                   'array_chunk'
          3        INIT_FCALL                                                   'array_values'
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                             $5      
          6        SEND_VAR                                                     $5
          7        SEND_VAL                                                     2
          8        DO_ICALL                                             $6      
          9      > FE_RESET_R                                           $7      $6, ->18
         10    > > FE_FETCH_R                                                   $7, $8, ->18
         11    >   FETCH_LIST_R                                         $9      $8, 0
         12        ASSIGN                                                       !2, $9
         13        FETCH_LIST_R                                         $11     $8, 1
         14        ASSIGN_DIM                                                   !1, !2
         15        OP_DATA                                                      $11
         16        FREE                                                         $8
         17      > JMP                                                          ->10
         18    >   FE_FREE                                                      $7
   14    19        INIT_FCALL                                                   'var_export'
         20        SEND_VAR                                                     !1
         21        DO_ICALL                                                     
         22      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.7 ms | 1868 KiB | 16 Q