3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = 'YO_{ YO_{ YO_{ YO_{ McDonalds. } } } }';; $test = preg_replace_callback($p = '/YO_\{(.*)\}/s', $f = function($matches) use (&$f, &$p) { return preg_match($p, $matches[1]) ?trim(preg_replace_callback($p, $f, $matches[1])) :$matches[1]; }, $test); echo $test;

preferences:
41.81 ms | 402 KiB | 5 Q