I wrote a couple of simple functions to parse out a URL MVC-style (based on kissmvc.com) and this is the only php in my document root:
<?php
require '../bootstrap.php';
parse_request();
So, if something did happen, that's all anyone would see. Everything else is handled starting at bootstrap. If I wanted, I could move the parse_request() into bootstrap.php, too, but I did it this way so I could include my bootstrap and not dispatch all the web site stuff if I was only hitting a cron script (and this was before I realized about the php_sapi_name() function and constant).
That does no good if you've got an existing site with php in the docroot, or are using Wordpress, etc, but if you have the option, it will prevent this specific problem from kicking you in the boys.