3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "ssssaaaaaaa"; $count = 0; for($i=0;$i<strlen($string)-1;$i++) { if($string[$i] == $string($i+1)) { $count++; } } echo $count;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 4
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 4
Branch analysis from position: 17
Branch analysis from position: 4
Branch analysis from position: 12
filename:       /in/99kl8
function name:  (null)
number of ops:  19
compiled vars:  !0 = $string, !1 = $count, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'ssssaaaaaaa'
    4     1        ASSIGN                                                   !1, 0
    5     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->13
    6     4    >   FETCH_DIM_R                                      ~6      !0, !2
          5        INIT_DYNAMIC_CALL                                        !0
          6        ADD                                              ~7      !2, 1
          7        SEND_VAL_EX                                              ~7
          8        DO_FCALL                                      0  $8      
          9        IS_EQUAL                                                 $8, ~6
         10      > JMPZ                                                     ~9, ->12
    7    11    >   PRE_INC                                                  !1
    5    12    >   PRE_INC                                                  !2
         13    >   STRLEN                                           ~12     !0
         14        SUB                                              ~13     ~12, 1
         15        IS_SMALLER                                               !2, ~13
         16      > JMPNZ                                                    ~14, ->4
   10    17    >   ECHO                                                     !1
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.34 ms | 1394 KiB | 13 Q