3v4l.org

run code in 500+ PHP versions simultaneously
<?php error_reporting(0); function f($s){for($i=-($l=strlen($s));$i<$l;$I=abs(++$i)){$t=substr($s,$I);echo str_repeat(' ',$I).strrev($t).substr($t,1)."\n";}} echo "------------\n"; f(" desserts"); echo "------------\n";

preferences:
45.93 ms | 2250 KiB | 5 Q