3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'key1\value1\key2\value2\key3\value3\key4\value4\key5\value5'; $result = []; foreach ( array_chunk(explode('\\', $string), 2) as [$key, $result[$key]] ); var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 19
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 19
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/p3mhG
function name:  (null)
number of ops:  24
compiled vars:  !0 = $string, !1 = $result, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'key1%5Cvalue1%5Ckey2%5Cvalue2%5Ckey3%5Cvalue3%5Ckey4%5Cvalue4%5Ckey5%5Cvalue5'
    5     1        ASSIGN                                                   !1, <array>
    7     2        INIT_FCALL                                               'array_chunk'
          3        INIT_FCALL                                               'explode'
          4        SEND_VAL                                                 '%5C'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $5      
          7        SEND_VAR                                                 $5
          8        SEND_VAL                                                 2
          9        DO_ICALL                                         $6      
         10      > FE_RESET_R                                       $7      $6, ->19
         11    > > FE_FETCH_R                                               $7, $8, ->19
         12    >   FETCH_LIST_R                                     $9      $8, 0
    9    13        ASSIGN                                                   !2, $9
         14        FETCH_LIST_R                                     $11     $8, 1
         15        ASSIGN_DIM                                               !1, !2
         16        OP_DATA                                                  $11
         17        FREE                                                     $8
    7    18      > JMP                                                      ->11
         19    >   FE_FREE                                                  $7
   11    20        INIT_FCALL                                               'var_export'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.91 ms | 1395 KiB | 19 Q