<?php
error_reporting(E_ERROR);

// The width of the ground is intentionally reduced here.
$f = function($l){for($y=count($l);$y>=0;$f[]="$a|   |$a")$a=str_repeat($y--?$w=' ':'-',9);
foreach($l as$x){for($x+=11,$s=$y=0;!$s;$b[$x]!=$w?$b[$x+1]!=$w?$b[$x-1]!=$w?$s=1:--$x
:++$x:0)$b=$f[$y++];$f[$y-2][$x]=a;}echo join('
',$f);};

$f([-3, 5, 5, -4, -4, 5, -3]);            echo "\n\n";
$f([3, 3, 3, 3, 8, 9]);                   echo "\n\n";
$f([-5, -5, -5, -5, -5, -5, -5, -5, -5]); echo "\n\n";