3v4l.org

run code in 500+ PHP versions simultaneously
<?php //echo '<pre>';print_r($sArray);echo '</pre>';die; function findRepeatingStringCount($sArray) { $left = $sArray[0]; $right = $sArray[0]; $i = 0; while ($i < count($sArray)) { if ($left == $right) { return $i + 1; } $right = $sArray[$i]; $i++; } return 0; } $s = "abcabcbb"; // string to array $sArray = str_split($s); echo '<pre>';print_r(findRepeatingStringCount($sArray));echo '</pre>';die;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 61) Position 1 = -2
filename:       /in/FnIre
function name:  (null)
number of ops:  16
compiled vars:  !0 = $s, !1 = $sArray
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   26     0  E >   ASSIGN                                                       !0, 'abcabcbb'
   28     1        INIT_FCALL                                                   'str_split'
          2        SEND_VAR                                                     !0
          3        DO_ICALL                                             $3      
          4        ASSIGN                                                       !1, $3
   30     5        ECHO                                                         '%3Cpre%3E'
          6        INIT_FCALL                                                   'print_r'
          7        INIT_FCALL                                                   'findrepeatingstringcount'
          8        SEND_VAR                                                     !1
          9        DO_FCALL                                          0  $5      
         10        SEND_VAR                                                     $5
         11        DO_ICALL                                                     
         12        ECHO                                                         '%3C%2Fpre%3E'
         13      > INIT_FCALL                                                   'exit'
         14*       DO_ICALL                                                     
   31    15*     > RETURN                                                       1

Function findrepeatingstringcount:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 7
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 7
Branch analysis from position: 17
Branch analysis from position: 7
filename:       /in/FnIre
function name:  findRepeatingStringCount
number of ops:  19
compiled vars:  !0 = $sArray, !1 = $left, !2 = $right, !3 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   RECV                                                 !0      
    9     1        FETCH_DIM_R                                          ~4      !0, 0
          2        ASSIGN                                                       !1, ~4
   10     3        FETCH_DIM_R                                          ~6      !0, 0
          4        ASSIGN                                                       !2, ~6
   11     5        ASSIGN                                                       !3, 0
   13     6      > JMP                                                          ->14
   15     7    >   IS_EQUAL                                                     !1, !2
          8      > JMPZ                                                         ~9, ->11
   16     9    >   ADD                                                  ~10     !3, 1
         10      > RETURN                                                       ~10
   19    11    >   FETCH_DIM_R                                          ~11     !0, !3
         12        ASSIGN                                                       !2, ~11
   20    13        PRE_INC                                                      !3
   13    14    >   COUNT                                                ~14     !0
         15        IS_SMALLER                                                   !3, ~14
         16      > JMPNZ                                                        ~15, ->7
   23    17    > > RETURN                                                       0
   24    18*     > RETURN                                                       null

End of function findrepeatingstringcount

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
173.57 ms | 1376 KiB | 17 Q