3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '(2+3-4*2(1+1-2)+(2+2)-3+4+2-5*4+2*(1+1))+2+(1+1)'; preg_match_all("/\((([^()]*|(?R))*)\)/",$string,$matches); var_dump($matches);

preferences:
37.03 ms | 402 KiB | 5 Q