3v4l.org

run code in 500+ PHP versions simultaneously
<?php $args = [ "(AAA/)(BBB/)(cc)", "(AAA/)xxxx(BBB/)(cc)", "(mystring123/)", "(\\mystring123\\)", ]; foreach ($args as $arg) { if (!preg_match_all("#^(?:\([/a-zA-Z0-9_\\\\-]+\))+$#", $arg, $matches, PREG_OFFSET_CAPTURE)) { var_dump($matches); echo 'The simple pattern "' . $arg . '" is not valid !'; //throw new \Exception('The simple pattern "' . $arg . '" is not valid !'); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 18
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 17
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 17
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/aVJBo
function name:  (null)
number of ops:  20
compiled vars:  !0 = $args, !1 = $arg, !2 = $matches
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   10     1      > FE_RESET_R                                           $4      !0, ->18
          2    > > FE_FETCH_R                                                   $4, !1, ->18
   11     3    >   INIT_FCALL                                                   'preg_match_all'
          4        SEND_VAL                                                     '%23%5E%28%3F%3A%5C%28%5B%2Fa-zA-Z0-9_%5C%5C-%5D%2B%5C%29%29%2B%24%23'
          5        SEND_VAR                                                     !1
          6        SEND_REF                                                     !2
          7        SEND_VAL                                                     256
          8        DO_ICALL                                             $5      
          9        BOOL_NOT                                             ~6      $5
         10      > JMPZ                                                         ~6, ->17
   12    11    >   INIT_FCALL                                                   'var_dump'
         12        SEND_VAR                                                     !2
         13        DO_ICALL                                                     
   13    14        CONCAT                                               ~8      'The+simple+pattern+%22', !1
         15        CONCAT                                               ~9      ~8, '%22+is+not+valid+%21'
         16        ECHO                                                         ~9
   10    17    > > JMP                                                          ->2
         18    >   FE_FREE                                                      $4
   16    19      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
181.5 ms | 2033 KiB | 14 Q