3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = "__('This is a (TEST) all of this i want') i dont want any of this; __(extract this)"; if (preg_match_all('~__(\(((?:[^()]++|(?1))*)\))~', $s, $matches)) { print_r($matches[2]); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/icd5O
function name:  (null)
number of ops:  12
compiled vars:  !0 = $s, !1 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '__%28%27This+is+a+%28TEST%29+all+of+this+i+want%27%29+i+dont+want+any+of+this%3B+__%28extract+this%29'
    4     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%7E__%28%5C%28%28%28%3F%3A%5B%5E%28%29%5D%2B%2B%7C%28%3F1%29%29%2A%29%5C%29%29%7E'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                         $3      
          6      > JMPZ                                                     $3, ->11
    5     7    >   INIT_FCALL                                               'print_r'
          8        FETCH_DIM_R                                      ~4      !1, 2
          9        SEND_VAL                                                 ~4
         10        DO_ICALL                                                 
    6    11    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.07 ms | 999 KiB | 15 Q