3v4l.org

run code in 300+ PHP versions simultaneously
<?php $conf = <<<EOF #DHCP Server Configuration file. deny unknown-clients; subnet 10.8.140.2 netmask 255.255.255.255 { host example{ optian:param; } host example2{ option2:param2; } } subnet 20.8.110.1 netmask 255.255.255.255 { } EOF; $pattern = '/(subnet.*?)*\{((?>[^{}]+)|(?R))*\}/'; preg_match_all($pattern, $conf, $matches); foreach($matches[0] as $match) { echo $match . PHP_EOL . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/Whh9i
function name:  (null)
number of ops:  16
compiled vars:  !0 = $conf, !1 = $pattern, !2 = $matches, !3 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%23DHCP+Server+Configuration+file.%0A%0Adeny+unknown-clients%3B%0A%0Asubnet+10.8.140.2+netmask+255.255.255.255+%7B%0A++++host+example%7B%0A++++++++++++optian%3Aparam%3B%0A++++%7D%0A++++host+example2%7B%0A++++++++++++option2%3Aparam2%3B%0A++++%7D%0A%7D%0A%0Asubnet+20.8.110.1+netmask+255.255.255.255+%7B%0A%0A%7D'
   22     1        ASSIGN                                                   !1, '%2F%28subnet.%2A%3F%29%2A%5C%7B%28%28%3F%3E%5B%5E%7B%7D%5D%2B%29%7C%28%3FR%29%29%2A%5C%7D%2F'
   24     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                                 
   26     7        FETCH_DIM_R                                      ~7      !2, 0
          8      > FE_RESET_R                                       $8      ~7, ->14
          9    > > FE_FETCH_R                                               $8, !3, ->14
   27    10    >   CONCAT                                           ~9      !3, '%0A'
         11        CONCAT                                           ~10     ~9, '%0A'
         12        ECHO                                                     ~10
   26    13      > JMP                                                      ->9
         14    >   FE_FREE                                                  $8
   28    15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.98 ms | 1395 KiB | 15 Q