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 === ';' && $current !== $prevChar) { $count++; } else { $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 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 9
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 49
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
Branch analysis from position: 9
2 jumps found. (Code = 46) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 9
Branch analysis from position: 32
Branch analysis from position: 9
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Branch analysis from position: 15
filename:       /in/MJWrM
function name:  (null)
number of ops:  50
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, ''
   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                                                      ->30
   20     9    >   FETCH_DIM_R                                      ~16     !1, !6
         10        ASSIGN                                                   !7, ~16
   21    11        IS_IDENTICAL                                     ~18     !7, '%3B'
         12      > JMPZ_EX                                          ~18     ~18, ->15
         13    >   IS_NOT_IDENTICAL                                 ~19     !7, !2
         14        BOOL                                             ~18     ~19
         15    > > JMPZ                                                     ~18, ->18
   22    16    >   PRE_INC                                                  !3
         17      > JMP                                                      ->20
   24    18    >   ASSIGN                                                   !3, 0
   25    19      > JMP                                                      ->32
   28    20    >   INIT_FCALL                                               'strpos'
         21        SEND_VAR                                                 !5
         22        SEND_VAR                                                 !7
         23        DO_ICALL                                         $22     
         24        TYPE_CHECK                                    4          $22
         25      > JMPZ                                                     ~23, ->28
   29    26    >   ASSIGN                                                   !3, 0
   30    27      > JMP                                                      ->32
   32    28    >   ASSIGN                                                   !2, !7
   19    29        PRE_INC                                                  !6
         30    >   IS_SMALLER                                               !6, !4
         31      > JMPNZ                                                    ~27, ->9
   35    32    >   INIT_FCALL                                               'var_dump'
         33        SEND_VAR                                                 !3
         34        DO_ICALL                                                 
   37    35        INIT_FCALL                                               'preg_match'
         36        CONCAT                                           ~29     '%2F', !0
         37        CONCAT                                           ~30     ~29, '%2F'
         38        SEND_VAL                                                 ~30
         39        SEND_VAR                                                 !1
         40        DO_ICALL                                         $31     
         41      > JMPZ                                                     $31, ->49
   38    42    >   INIT_FCALL                                               'var_dump'
         43        INIT_FCALL                                               'substr_count'
         44        SEND_VAR                                                 !1
         45        SEND_VAL                                                 '%3B'
         46        DO_ICALL                                         $32     
         47        SEND_VAR                                                 $32
         48        DO_ICALL                                                 
   39    49    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.88 ms | 1392 KiB | 21 Q