3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo preg_replace('`\((?:[^()]*|(?R))++\)`', '<$0>', 'test {22413}(ghfhgfhg(())sd(d)sf) sdfdsf {5}(45d4fsdf4)');
Output for 4.3.0 - 5.3.18, 5.4.0 - 5.4.8, 5.4.41 - 5.4.45, 5.5.25 - 5.5.35, 5.6.9 - 5.6.21, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
test {22413}(ghfhgfhg(<()>)sd<(d)>sf) sdfdsf {5}<(45d4fsdf4)>
Output for 5.3.19 - 5.3.29, 5.4.9 - 5.4.40, 5.5.24, 5.6.8
test {22413}<(ghfhgfhg(())sd(d)sf)> sdfdsf {5}<(45d4fsdf4)>