3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function f( $str ){ $l = strlen($str); for( $i = -$l; $i < $l; $i++ ){ $I = abs($i); $s = substr($str,$I,-1); echo str_repeat(',',$I) . strrev($s) . $s . "\n"; } } echo "------------\n"; f(".desserts"); echo "------------\n";
based on 08EQ6
Output for 4.3.0 - 7.2.0
------------ ,,,,,,,,, ,,,,,,,, ,,,,,,,tt ,,,,,,trrt ,,,,,treert ,,,,tressert ,,,tressssert ,,tresseessert ,tresseddessert tressed..dessert ,tresseddessert ,,tresseessert ,,,tressssert ,,,,tressert ,,,,,treert ,,,,,,trrt ,,,,,,,tt ,,,,,,,, ------------