3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = 'key1\value1\key2\value2\key3\value3\key4\value4\key5\value5'; $result = []; $key = strtok($string, "\\"); while ($key !== false) { $result[$key] = strtok("\\"); $key = strtok("\\"); } var_export($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 8
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 8
Branch analysis from position: 19
Branch analysis from position: 8
filename:       /in/4aGOO
function name:  (null)
number of ops:  23
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>
    6     2        INIT_FCALL                                                   'strtok'
          3        SEND_VAR                                                     !0
          4        SEND_VAL                                                     '%5C'
          5        DO_ICALL                                             $5      
          6        ASSIGN                                                       !2, $5
    7     7      > JMP                                                          ->17
    8     8    >   INIT_FCALL                                                   'strtok'
          9        SEND_VAL                                                     '%5C'
         10        DO_ICALL                                             $8      
         11        ASSIGN_DIM                                                   !1, !2
         12        OP_DATA                                                      $8
    9    13        INIT_FCALL                                                   'strtok'
         14        SEND_VAL                                                     '%5C'
         15        DO_ICALL                                             $9      
         16        ASSIGN                                                       !2, $9
    7    17    >   TYPE_CHECK                                      1018          !2
         18      > JMPNZ                                                        ~11, ->8
   11    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:
194.04 ms | 1875 KiB | 15 Q