3v4l.org

run code in 500+ PHP versions simultaneously
<?php $strings = ["(AAA/)(BBB/)(cc)", "(AAA/)xxxx(BBB/)(cc)"]; foreach ($strings as $string) { if (!preg_match('~^(?:\([\w\\/-]+\))+$~', $string)) { echo "The simple pattern $string is not valid!"; // throw new \Exception("The simple pattern $string is not valid!"); } else { var_export(preg_split('~\)\K~', $string, 0, PREG_SPLIT_NO_EMPTY)); } echo "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 22
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 22
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
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: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/78AiZ
function name:  (null)
number of ops:  24
compiled vars:  !0 = $strings, !1 = $string
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
    4     1      > FE_RESET_R                                           $3      !0, ->22
          2    > > FE_FETCH_R                                                   $3, !1, ->22
    5     3    >   FRAMELESS_ICALL_2                preg_match          ~4      '%7E%5E%28%3F%3A%5C%28%5B%5Cw%5C%2F-%5D%2B%5C%29%29%2B%24%7E', !1
          4        BOOL_NOT                                             ~5      ~4
          5      > JMPZ                                                         ~5, ->11
    6     6    >   ROPE_INIT                                         3  ~7      'The+simple+pattern+'
          7        ROPE_ADD                                          1  ~7      ~7, !1
          8        ROPE_END                                          2  ~6      ~7, '+is+not+valid%21'
          9        ECHO                                                         ~6
    5    10      > JMP                                                          ->20
    9    11    >   INIT_FCALL                                                   'var_export'
         12        INIT_FCALL                                                   'preg_split'
         13        SEND_VAL                                                     '%7E%5C%29%5CK%7E'
         14        SEND_VAR                                                     !1
         15        SEND_VAL                                                     0
         16        SEND_VAL                                                     1
         17        DO_ICALL                                             $9      
         18        SEND_VAR                                                     $9
         19        DO_ICALL                                                     
   11    20    >   ECHO                                                         '%0A'
    4    21      > JMP                                                          ->2
         22    >   FE_FREE                                                      $3
   12    23      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.56 ms | 2020 KiB | 15 Q