3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str = "Part1:Part2:Part3:Part4"; $parts = explode(':', $str); $result = []; for ($i = 0; $i < count($parts); $i++) { $i % 2 === 0 ? $k = $parts[$i] : $result[$k] = $parts[$i]; } print_r($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 9
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 9
Branch analysis from position: 25
Branch analysis from position: 9
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 9
Branch analysis from position: 25
Branch analysis from position: 9
filename:       /in/9KJB0
function name:  (null)
number of ops:  29
compiled vars:  !0 = $str, !1 = $parts, !2 = $result, !3 = $i, !4 = $k
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'Part1%3APart2%3APart3%3APart4'
    4     1        INIT_FCALL                                                   'explode'
          2        SEND_VAL                                                     '%3A'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                             $6      
          5        ASSIGN                                                       !1, $6
    5     6        ASSIGN                                                       !2, <array>
    7     7        ASSIGN                                                       !3, 0
          8      > JMP                                                          ->22
    8     9    >   MOD                                                  ~10     !3, 2
         10        IS_IDENTICAL                                                 ~10, 0
         11      > JMPZ                                                         ~11, ->16
         12    >   FETCH_DIM_R                                          ~12     !1, !3
         13        ASSIGN                                               ~13     !4, ~12
         14        QM_ASSIGN                                            ~14     ~13
         15      > JMP                                                          ->20
         16    >   FETCH_DIM_R                                          ~16     !1, !3
         17        ASSIGN_DIM                                           ~15     !2, !4
         18        OP_DATA                                                      ~16
         19        QM_ASSIGN                                            ~14     ~15
         20    >   FREE                                                         ~14
    7    21        PRE_INC                                                      !3
         22    >   COUNT                                                ~18     !1
         23        IS_SMALLER                                                   !3, ~18
         24      > JMPNZ                                                        ~19, ->9
   10    25    >   INIT_FCALL                                                   'print_r'
         26        SEND_VAR                                                     !2
         27        DO_ICALL                                                     
         28      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
167.75 ms | 2003 KiB | 15 Q