3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string='Foo, Bar, Test, X, Y, Z,O,'; $pos=0; $count=0; while($pos = strpos($string, ' ')){ $string = substr($string, strpos($string, " "), strlen($string)); $pos =strpos($string, " "); echo $string.$pos."<br />"; } echo $count;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 4
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 4
Branch analysis from position: 29
Branch analysis from position: 4
filename:       /in/6kOfF
function name:  (null)
number of ops:  31
compiled vars:  !0 = $string, !1 = $pos, !2 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'Foo%2C+Bar%2C+Test%2C+X%2C+Y%2C+Z%2CO%2C'
    3     1        ASSIGN                                                   !1, 0
    4     2        ASSIGN                                                   !2, 0
    5     3      > JMP                                                      ->23
    6     4    >   INIT_FCALL                                               'substr'
          5        SEND_VAR                                                 !0
          6        INIT_FCALL                                               'strpos'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 '+'
          9        DO_ICALL                                         $6      
         10        SEND_VAR                                                 $6
         11        STRLEN                                           ~7      !0
         12        SEND_VAL                                                 ~7
         13        DO_ICALL                                         $8      
         14        ASSIGN                                                   !0, $8
    7    15        INIT_FCALL                                               'strpos'
         16        SEND_VAR                                                 !0
         17        SEND_VAL                                                 '+'
         18        DO_ICALL                                         $10     
         19        ASSIGN                                                   !1, $10
    8    20        CONCAT                                           ~12     !0, !1
         21        CONCAT                                           ~13     ~12, '%3Cbr+%2F%3E'
         22        ECHO                                                     ~13
    5    23    >   INIT_FCALL                                               'strpos'
         24        SEND_VAR                                                 !0
         25        SEND_VAL                                                 '+'
         26        DO_ICALL                                         $14     
         27        ASSIGN                                           ~15     !1, $14
         28      > JMPNZ                                                    ~15, ->4
   10    29    >   ECHO                                                     !2
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.79 ms | 1396 KiB | 17 Q