3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pattern = '[a-z\d+#.-]+'; // Borrowed from @Hamza. $tags =<<<TAGS gg!!gd 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; } } 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 = 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 = 31
Branch analysis from position: 31
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: 18
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 15
filename:       /in/k9gX4
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, 'gg%21%21gd%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                                     ~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                                                      ->31
   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                                                      ->31
   19    28    >   PRE_INC                                                  !6
         29    >   IS_SMALLER                                               !6, !4
         30      > JMPNZ                                                    ~26, ->9
   34    31    >   INIT_FCALL                                               'var_dump'
         32        SEND_VAR                                                 !3
         33        DO_ICALL                                                 
   36    34        INIT_FCALL                                               'preg_match'
         35        CONCAT                                           ~28     '%2F', !0
         36        CONCAT                                           ~29     ~28, '%2F'
         37        SEND_VAL                                                 ~29
         38        SEND_VAR                                                 !1
         39        DO_ICALL                                         $30     
         40      > JMPZ                                                     $30, ->48
   37    41    >   INIT_FCALL                                               'var_dump'
         42        INIT_FCALL                                               'substr_count'
         43        SEND_VAR                                                 !1
         44        SEND_VAL                                                 '%3B'
         45        DO_ICALL                                         $31     
         46        SEND_VAR                                                 $31
         47        DO_ICALL                                                 
   38    48    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.2 ms | 1400 KiB | 21 Q