3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '($a * 10 + $b) Euro and (10 + 2) cents'; $regex = '#\((([^()]+|(?R))*)\)#'; if (preg_match_all($regex, $string ,$matches)) { echo var_export($matches[1], true); } else { //no parenthesis echo $string; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r8EBb
function name:  (null)
number of ops:  17
compiled vars:  !0 = $string, !1 = $regex, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%28%24a+%2A+10+%2B+%24b%29+Euro+and+%2810+%2B+2%29+cents'
    3     1        ASSIGN                                                   !1, '%23%5C%28%28%28%5B%5E%28%29%5D%2B%7C%28%3FR%29%29%2A%29%5C%29%23'
    4     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                         $5      
          7      > JMPZ                                                     $5, ->15
    5     8    >   INIT_FCALL                                               'var_export'
          9        FETCH_DIM_R                                      ~6      !2, 1
         10        SEND_VAL                                                 ~6
         11        SEND_VAL                                                 <true>
         12        DO_ICALL                                         $7      
         13        ECHO                                                     $7
         14      > JMP                                                      ->16
    8    15    >   ECHO                                                     !0
    9    16    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.75 ms | 1395 KiB | 17 Q