3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str = <<<_ var Data = { 'a': 1, 'b': '{"a":[{"b":{"id":1}}]}' } var Data = { 'a': 2, 'b': '{"a":[{"b":{"id":2}}]}' }; // Some other text here that may have }; or }. Blahblah blah. // }; // } _; preg_match_all('~Data\s*=\s{(?:[^:}]*:.*\R+)+}~', $str, $matches); print_r($matches[0]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HdiRE
function name:  (null)
number of ops:  11
compiled vars:  !0 = $str, !1 = $matches
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'var+Data+%3D+%7B%0A++++%27a%27%3A+1%2C%0A++++%27b%27%3A+%27%7B%22a%22%3A%5B%7B%22b%22%3A%7B%22id%22%3A1%7D%7D%5D%7D%27%0A%7D%0A%0Avar+Data+%3D+%7B%0A++++%27a%27%3A+2%2C%0A++++%27b%27%3A+%27%7B%22a%22%3A%5B%7B%22b%22%3A%7B%22id%22%3A2%7D%7D%5D%7D%27%0A%7D%3B%0A%0A%2F%2F+Some+other+text+here+that+may+have+%7D%3B+or+%7D.+Blahblah+blah.%0A%2F%2F+%7D%3B%0A%2F%2F+%7D'
   19     1        INIT_FCALL                                                   'preg_match_all'
          2        SEND_VAL                                                     '%7EData%5Cs%2A%3D%5Cs%7B%28%3F%3A%5B%5E%3A%7D%5D%2A%3A.%2A%5CR%2B%29%2B%7D%7E'
          3        SEND_VAR                                                     !0
          4        SEND_REF                                                     !1
          5        DO_ICALL                                                     
   20     6        INIT_FCALL                                                   'print_r'
          7        FETCH_DIM_R                                          ~4      !1, 0
          8        SEND_VAL                                                     ~4
          9        DO_ICALL                                                     
         10      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
179.64 ms | 2575 KiB | 15 Q