3v4l.org

run code in 200+ 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.38, 5.6.9 - 5.6.38, hhvm-3.10.1 - 3.22.0, 7.0.0 - 7.2.11
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.0 - 5.5.24, 5.6.0 - 5.6.8
test {22413}<(ghfhgfhg(())sd(d)sf)> sdfdsf {5}<(45d4fsdf4)>