3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pattern = '[a-z\d+#.-]+'; // Borrowed from @Hamza. $tags =<<<TAGS gggd hfhfghg;hfhdfh fgjfgjgf;hfhdfh;hfhdfh fgjgfj;hfhdfh;hfhdfh;hfhdfh hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh TAGS; $prevChar = ';'; $count = 0; $len = strlen($tags); $allowedChars = ';abcdefghijklmnopqrstuvwxyz0123456789#.-'; for ($i = 0; $i < $len; $i++) { $current = $tags[$i]; if ($current === ';') { $count++; continue; } if ($current === $prevChar) { $count = 0; break; } if (strpos($allowedChars, $current) === false) { $count = 0; break; } $prevChar = $current; } var_dump($count); if (preg_match('/'.$pattern.'/', $tags)) { var_dump(substr_count($tags, ';')); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 9
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 48
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 48
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 9
Branch analysis from position: 31
Branch analysis from position: 9
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 9
Branch analysis from position: 31
Branch analysis from position: 9
filename:       /in/v0Qcd
function name:  (null)
number of ops:  49
compiled vars:  !0 = $pattern, !1 = $tags, !2 = $prevChar, !3 = $count, !4 = $len, !5 = $allowedChars, !6 = $i, !7 = $current
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%5Ba-z%5Cd%2B%23.-%5D%2B'
    4     1        ASSIGN                                                   !1, 'gggd%0Ahfhfghg%3Bhfhdfh%0Afgjfgjgf%3Bhfhdfh%3Bhfhdfh%0Afgjgfj%3Bhfhdfh%3Bhfhdfh%3Bhfhdfh%0Ahfhdfh%3Bhfhdfh%3Bhfhdfh%3Bhfhdfh%3Bhfhdfh%0Ahfhdfh%3Bhfhdfh%3Bhfhdfh%3Bhfhdfh%3Bhfhdfh%3Bhfhdfh%0Ahfhdfh%3Bhfhdfh%3Bhfhdfh%3Bhfhdfh%3Bhfhdfh%3Bhfhdfh%3Bhfhdfh%0Ahfhdfh%3Bhfhdfh%3Bhfhdfh%3Bhfhdfh%3Bhfhdfh%3Bhfhdfh%3Bhfhdfh%3Bhfhdfh'
   15     2        ASSIGN                                                   !2, '%3B'
   16     3        ASSIGN                                                   !3, 0
   17     4        STRLEN                                           ~12     !1
          5        ASSIGN                                                   !4, ~12
   18     6        ASSIGN                                                   !5, '%3Babcdefghijklmnopqrstuvwxyz0123456789%23.-'
   19     7        ASSIGN                                                   !6, 0
          8      > JMP                                                      ->29
   20     9    >   FETCH_DIM_R                                      ~16     !1, !6
         10        ASSIGN                                                   !7, ~16
   21    11        IS_IDENTICAL                                             !7, '%3B'
         12      > JMPZ                                                     ~18, ->15
   22    13    >   PRE_INC                                                  !3
   23    14      > JMP                                                      ->28
   26    15    >   IS_IDENTICAL                                             !7, !2
         16      > JMPZ                                                     ~20, ->19
   27    17    >   ASSIGN                                                   !3, 0
   28    18      > JMP                                                      ->31
   31    19    >   INIT_FCALL                                               'strpos'
         20        SEND_VAR                                                 !5
         21        SEND_VAR                                                 !7
         22        DO_ICALL                                         $22     
         23        TYPE_CHECK                                    4          $22
         24      > JMPZ                                                     ~23, ->27
   32    25    >   ASSIGN                                                   !3, 0
   33    26      > JMP                                                      ->31
   35    27    >   ASSIGN                                                   !2, !7
   19    28    >   PRE_INC                                                  !6
         29    >   IS_SMALLER                                               !6, !4
         30      > JMPNZ                                                    ~27, ->9
   38    31    >   INIT_FCALL                                               'var_dump'
         32        SEND_VAR                                                 !3
         33        DO_ICALL                                                 
   40    34        INIT_FCALL                                               'preg_match'
         35        CONCAT                                           ~29     '%2F', !0
         36        CONCAT                                           ~30     ~29, '%2F'
         37        SEND_VAL                                                 ~30
         38        SEND_VAR                                                 !1
         39        DO_ICALL                                         $31     
         40      > JMPZ                                                     $31, ->48
   41    41    >   INIT_FCALL                                               'var_dump'
         42        INIT_FCALL                                               'substr_count'
         43        SEND_VAR                                                 !1
         44        SEND_VAL                                                 '%3B'
         45        DO_ICALL                                         $32     
         46        SEND_VAR                                                 $32
         47        DO_ICALL                                                 
   42    48    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.35 ms | 1400 KiB | 21 Q