3v4l.org

run code in 300+ 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 = 25
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 25
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/78AiZ
function name:  (null)
number of ops:  27
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, ->25
          2    > > FE_FETCH_R                                               $3, !1, ->25
    5     3    >   INIT_FCALL                                               'preg_match'
          4        SEND_VAL                                                 '%7E%5E%28%3F%3A%5C%28%5B%5Cw%5C%2F-%5D%2B%5C%29%29%2B%24%7E'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $4      
          7        BOOL_NOT                                         ~5      $4
          8      > JMPZ                                                     ~5, ->14
    6     9    >   ROPE_INIT                                     3  ~7      'The+simple+pattern+'
         10        ROPE_ADD                                      1  ~7      ~7, !1
         11        ROPE_END                                      2  ~6      ~7, '+is+not+valid%21'
         12        ECHO                                                     ~6
    5    13      > JMP                                                      ->23
    9    14    >   INIT_FCALL                                               'var_export'
         15        INIT_FCALL                                               'preg_split'
         16        SEND_VAL                                                 '%7E%5C%29%5CK%7E'
         17        SEND_VAR                                                 !1
         18        SEND_VAL                                                 0
         19        SEND_VAL                                                 1
         20        DO_ICALL                                         $9      
         21        SEND_VAR                                                 $9
         22        DO_ICALL                                                 
   11    23    >   ECHO                                                     '%0A'
    4    24      > JMP                                                      ->2
         25    >   FE_FREE                                                  $3
   12    26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
376.79 ms | 1072 KiB | 16 Q