3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test='lalala "foo bar" lalala'; $test = preg_replace_callback( '#"([^"]+)"#si', function ($match) { return stripslashes(str_replace(' ', '*', $match[0])); }, $test ); echo $test;

preferences:
72.51 ms | 402 KiB | 5 Q