3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'second third first'; echo substr($str, strrpos($str, " ")+1) . " " . substr($str, 0, strrpos($str, " "));

preferences:
24.69 ms | 405 KiB | 5 Q