That's why you do symlink-based deployments with PHP. It works just fine and is also not a problem unique to PHP.
PHP itself doesn't follow filesystem-based routing, your webserver config does. PHP just executes what th webserver tells it to. Most PHP applications written in the last 10 years use a single entry point and are no longer prone to the attacks you are describing.