3v4l.org

run code in 300+ 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 = 16
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 16
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/RW8Ou
function name:  (null)
number of ops:  18
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, ->16
          2    > > FE_FETCH_R                                               $3, !1, ->16
    8     3    >   INIT_FCALL                                               'preg_match'
          4        SEND_VAL                                                 '%2F%5B%5E%5B%3Aalnum%3A%5D%5C-_%5D%2F'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $4      
          7        BOOL_NOT                                         ~5      $4
          8      > JMPZ                                                     ~5, ->12
    9     9    >   CONCAT                                           ~6      !1, '+is+valid.%0A'
         10        QM_ASSIGN                                        ~7      ~6
         11      > JMP                                                      ->14
   10    12    >   CONCAT                                           ~8      !1, '+is+NOT+valid.%0A'
         13        QM_ASSIGN                                        ~7      ~8
         14    >   ECHO                                                     ~7
    7    15      > JMP                                                      ->2
         16    >   FE_FREE                                                  $3
   12    17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
121.6 ms | 1444 KiB | 14 Q