3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = <<<DATA {start} SubPattern1 {end} {start} SubPattern2 {end} {start} {start}SubPattern3{end} {end} DATA; preg_match_all('/{start}((?:(?:(?!{(?:start|end)}).)+|(?R))*){end}/', $string, $result); print_r($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KY5cD
function name:  (null)
number of ops:  10
compiled vars:  !0 = $string, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7Bstart%7D+SubPattern1+%7Bend%7D+%0A%7Bstart%7D+SubPattern2+%7Bend%7D%0A%7Bstart%7D+%7Bstart%7DSubPattern3%7Bend%7D+%7Bend%7D'
    9     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%2F%7Bstart%7D%28%28%3F%3A%28%3F%3A%28%3F%21%7B%28%3F%3Astart%7Cend%29%7D%29.%29%2B%7C%28%3FR%29%29%2A%29%7Bend%7D%2F'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
   10     6        INIT_FCALL                                               'print_r'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.55 ms | 1001 KiB | 15 Q