3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo preg_replace_callback('/\b[^\s]*a\b/i', fn($matches) => str_replace("a", "o", $matches[0]), 'kak kaka aaak aaa');

preferences:
23.29 ms | 405 KiB | 5 Q