3v4l.org

run code in 300+ PHP versions simultaneously
<?php function remove_shout($_text,$_max_caps=3) { return preg_replace_callback('/[A-Z]{$_max_caps,}/',function($matches) { return strtolower($matches[0]); },$_text); } $input = "This is so AWESOME COOL!"; echo remove_shout($input);

preferences:
53.22 ms | 402 KiB | 5 Q