Mazes with graphs are complex enough, let alone with a matrix instead.
Lets get some information on the usage first. This findNeighbours method, is this designed to find all immediate neighbours, or only traversable ones (in this case the ones with symbol type ' ', ?, and ! from that I can tell of the image)? I would suggest its doing a bit too much work overall on its own. I would perceive that a neighbour would only be up to 4 possible objects (8 if you can move diagonally, but I only see 4 when using the CLI which makes more sense). So should we only be finding the immediate neighbours for an item that we can actually move to?
header('HTTP/1.1 420 Enhance Your Calm');