3v4l.org

run code in 300+ PHP versions simultaneously
<?php $temp="test 1-123.456\ntest 2-789.0\n"; $tok=strtok($temp,"\n"); while ($tok !== false) { $pos=strpos($tok,'-'); $pos2=strpos($tok,'.',$pos); $temp2=substr($tok,0,$pos); $pos++; $wordlist[$temp2]=array((int)substr($tok,$pos,$pos2-$pos),(int)substr($tok,$pos2+1)); $tok=strtok("\n"); } print_r($wordlist);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 7
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 7
Branch analysis from position: 48
Branch analysis from position: 7
filename:       /in/3O80M
function name:  (null)
number of ops:  52
compiled vars:  !0 = $temp, !1 = $tok, !2 = $pos, !3 = $pos2, !4 = $temp2, !5 = $wordlist
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'test+1-123.456%0Atest+2-789.0%0A'
    4     1        INIT_FCALL                                               'strtok'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '%0A'
          4        DO_ICALL                                         $7      
          5        ASSIGN                                                   !1, $7
    5     6      > JMP                                                      ->46
    7     7    >   INIT_FCALL                                               'strpos'
          8        SEND_VAR                                                 !1
          9        SEND_VAL                                                 '-'
         10        DO_ICALL                                         $9      
         11        ASSIGN                                                   !2, $9
    8    12        INIT_FCALL                                               'strpos'
         13        SEND_VAR                                                 !1
         14        SEND_VAL                                                 '.'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                         $11     
         17        ASSIGN                                                   !3, $11
    9    18        INIT_FCALL                                               'substr'
         19        SEND_VAR                                                 !1
         20        SEND_VAL                                                 0
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                         $13     
         23        ASSIGN                                                   !4, $13
   10    24        PRE_INC                                                  !2
   11    25        INIT_FCALL                                               'substr'
         26        SEND_VAR                                                 !1
         27        SEND_VAR                                                 !2
         28        SUB                                              ~17     !3, !2
         29        SEND_VAL                                                 ~17
         30        DO_ICALL                                         $18     
         31        CAST                                          4  ~19     $18
         32        INIT_ARRAY                                       ~20     ~19
         33        INIT_FCALL                                               'substr'
         34        SEND_VAR                                                 !1
         35        ADD                                              ~21     !3, 1
         36        SEND_VAL                                                 ~21
         37        DO_ICALL                                         $22     
         38        CAST                                          4  ~23     $22
         39        ADD_ARRAY_ELEMENT                                ~20     ~23
         40        ASSIGN_DIM                                               !5, !4
         41        OP_DATA                                                  ~20
   12    42        INIT_FCALL                                               'strtok'
         43        SEND_VAL                                                 '%0A'
         44        DO_ICALL                                         $24     
         45        ASSIGN                                                   !1, $24
    5    46    >   TYPE_CHECK                                  1018          !1
         47      > JMPNZ                                                    ~26, ->7
   14    48    >   INIT_FCALL                                               'print_r'
         49        SEND_VAR                                                 !5
         50        DO_ICALL                                                 
         51      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.6 ms | 1400 KiB | 21 Q