3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '"hi (text here) and (other text)" come (again) and "(again)", right?'; echo preg_replace( '~(?:\G(?!^)|"(?=[^"]+"))[^"()]*(?:"(*SKIP)(*FAIL)|\K[()])~', '\\\$0', $str );

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
148.96 ms | 2016 KiB | 9 Q