Yes, it is easily avoided. But it is still violated by lots of PHP projects, including well-known projects with large userbases:
* Wordpress
* Tiki
* ... and so on.
I don't think this is by accident: This technique is too old and well-known to be ignored by large projects. Rather, they conciously don't do that to cause less hassle for the occasional admin: Those can simply dump it into some directory and don't have to setup a proper docroot or anything. And extra work for those who want a more secure setup.This is clearly a usability versus security issue, resolved in the unfortunate, usual way.