3v4l.org

run code in 500+ PHP versions simultaneously
<?php $test = [ "tesT StriNg%&/()=?aj-hd_86b", "tesTStriNgaj-hd_86b" ]; foreach ($test as $str) { echo (!preg_match("/[^[:alnum:]\-_]/",$str)) ? $str." is valid.\n" : $str." is NOT valid.\n"; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 13
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/RW8Ou
function name:  (null)
number of ops:  15
compiled vars:  !0 = $test, !1 = $str
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
    7     1      > FE_RESET_R                                           $3      !0, ->13
          2    > > FE_FETCH_R                                                   $3, !1, ->13
    8     3    >   FRAMELESS_ICALL_2                preg_match          ~4      '%2F%5B%5E%5B%3Aalnum%3A%5D%5C-_%5D%2F', !1
          4        BOOL_NOT                                             ~5      ~4
          5      > JMPZ                                                         ~5, ->9
    9     6    >   CONCAT                                               ~6      !1, '+is+valid.%0A'
          7        QM_ASSIGN                                            ~7      ~6
          8      > JMP                                                          ->11
   10     9    >   CONCAT                                               ~8      !1, '+is+NOT+valid.%0A'
         10        QM_ASSIGN                                            ~7      ~8
         11    >   ECHO                                                         ~7
    7    12      > JMP                                                          ->2
         13    >   FE_FREE                                                      $3
   12    14      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.43 ms | 2604 KiB | 13 Q