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++; } $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 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 9
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 38
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
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 = 17
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 9
Branch analysis from position: 21
Branch analysis from position: 9
Branch analysis from position: 17
Branch analysis from position: 15
filename:       /in/0OXRl
function name:  (null)
number of ops:  39
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                                                      ->19
   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, ->17
   22    16    >   PRE_INC                                                  !3
   24    17    >   ASSIGN                                                   !2, !7
   19    18        PRE_INC                                                  !6
         19    >   IS_SMALLER                                               !6, !4
         20      > JMPNZ                                                    ~23, ->9
   27    21    >   INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !3
         23        DO_ICALL                                                 
   29    24        INIT_FCALL                                               'preg_match'
         25        CONCAT                                           ~25     '%2F', !0
         26        CONCAT                                           ~26     ~25, '%2F'
         27        SEND_VAL                                                 ~26
         28        SEND_VAR                                                 !1
         29        DO_ICALL                                         $27     
         30      > JMPZ                                                     $27, ->38
   30    31    >   INIT_FCALL                                               'var_dump'
         32        INIT_FCALL                                               'substr_count'
         33        SEND_VAR                                                 !1
         34        SEND_VAL                                                 '%3B'
         35        DO_ICALL                                         $28     
         36        SEND_VAR                                                 $28
         37        DO_ICALL                                                 
   31    38    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.45 ms | 1405 KiB | 19 Q