3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "this is a string with lots of spaces ."; while(strpos($str, " ") !== false) $str = str_replace(" ", " ", $str); echo $str;

preferences:
29.37 ms | 406 KiB | 5 Q