3v4l.org

run code in 300+ 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:
61.44 ms | 402 KiB | 5 Q