3v4l.org

run code in 300+ PHP versions simultaneously
<?php function printPyramid($rows){ for($i = 1; $i <= $rows; ++$i){ echo str_repeat("&nbsp;", $rows - $i); for($j = $i; $j >= 1; --$j){ echo $j; } for($j = 2; $j <= $i; ++$j){ echo $j; } echo PHP_EOL; } } printPyramid(7);

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
151.09 ms | 1758 KiB | 10 Q