3v4l.org

run code in 300+ PHP versions simultaneously
<?php $usernames = array('asdasd123', 'asdas_asdasd123', 'asdsad--asdsa123123', 'asdasd<><><>'); foreach($usernames as $u) { if(preg_match('([A-Za-z0-9\-\_]+)', $u)) { echo $u.' is totally valid'; } else { echo $u. 'is not valid'; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 14
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 14
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/H1Yjb
function name:  (null)
number of ops:  16
compiled vars:  !0 = $usernames, !1 = $u
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1      > FE_RESET_R                                       $3      !0, ->14
          2    > > FE_FETCH_R                                               $3, !1, ->14
    6     3    >   INIT_FCALL                                               'preg_match'
          4        SEND_VAL                                                 '%28%5BA-Za-z0-9%5C-%5C_%5D%2B%29'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $4      
          7      > JMPZ                                                     $4, ->11
    8     8    >   CONCAT                                           ~5      !1, '+is+totally+valid'
          9        ECHO                                                     ~5
         10      > JMP                                                      ->13
   12    11    >   CONCAT                                           ~6      !1, 'is+not+valid'
         12        ECHO                                                     ~6
    4    13    > > JMP                                                      ->2
         14    >   FE_FREE                                                  $3
   14    15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.64 ms | 1395 KiB | 15 Q