3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pattern = '~ (?<animal>) (?<color>) ^ (?<animal>DOG|CAT)? (?<color>RED|BLUE)? $ ~xiJ'; if ( preg_match($pattern, 'dog', $m) ) print_r(array_filter($m, 'is_string', ARRAY_FILTER_USE_KEY));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/s5QRi
function name:  (null)
number of ops:  16
compiled vars:  !0 = $pattern, !1 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%7E+%28%3F%3Canimal%3E%29+%28%3F%3Ccolor%3E%29%0A+++++++++++++%5E+%28%3F%3Canimal%3EDOG%7CCAT%29%3F+%28%3F%3Ccolor%3ERED%7CBLUE%29%3F+%24%0A++++++++++++%7ExiJ'
    6     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'dog'
          4        SEND_REF                                                 !1
          5        DO_ICALL                                         $3      
          6      > JMPZ                                                     $3, ->15
    7     7    >   INIT_FCALL                                               'print_r'
          8        INIT_FCALL                                               'array_filter'
          9        SEND_VAR                                                 !1
         10        SEND_VAL                                                 'is_string'
         11        SEND_VAL                                                 2
         12        DO_ICALL                                         $4      
         13        SEND_VAR                                                 $4
         14        DO_ICALL                                                 
         15    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.9 ms | 1011 KiB | 16 Q