3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array('key', 'value', 'key2'); $iterations = count($arr); $result = array(); for ($i = 0; $i < $iterations; $i += 2) $result[$arr[$i]] = isset($arr[$i + 1]) ? $arr[$i + 1] : null; var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 6
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 6
Branch analysis from position: 20
Branch analysis from position: 6
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 6
Branch analysis from position: 20
Branch analysis from position: 6
filename:       /in/T9LvA
function name:  (null)
number of ops:  24
compiled vars:  !0 = $arr, !1 = $iterations, !2 = $result, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        COUNT                                            ~5      !0
          2        ASSIGN                                                   !1, ~5
    5     3        ASSIGN                                                   !2, <array>
    7     4        ASSIGN                                                   !3, 0
          5      > JMP                                                      ->18
    8     6    >   FETCH_DIM_R                                      ~9      !0, !3
          7        ADD                                              ~11     !3, 1
          8        ISSET_ISEMPTY_DIM_OBJ                         0          !0, ~11
          9      > JMPZ                                                     ~12, ->14
         10    >   ADD                                              ~13     !3, 1
         11        FETCH_DIM_R                                      ~14     !0, ~13
         12        QM_ASSIGN                                        ~15     ~14
         13      > JMP                                                      ->15
         14    >   QM_ASSIGN                                        ~15     null
         15    >   ASSIGN_DIM                                               !2, ~9
         16        OP_DATA                                                  ~15
    7    17        ASSIGN_OP                                     1          !3, 2
         18    >   IS_SMALLER                                               !3, !1
         19      > JMPNZ                                                    ~17, ->6
   10    20    >   INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.57 ms | 1395 KiB | 15 Q