I get the impression this web app needs some refactoring. Also I like the laid back attitude...

"Well, we might not be able to load a library or two, but what the hell, we got around 120 of them, noone's gonna miss them. What? Raise an error? Fine, here, have a notice. Huh? the error message? It says include_once! Just poke around a bit till you find the problem. Sheesh..."

If the included file does not exist, or PHP in some other way fails to include the file then a E_WARNING error will be generated e.g.

Warning: include_once(nonexistant.php) [function.include-once]: failed to open stream: No such file or directory in /path/to/test.php on line 2
Warning: include_once() [function.include]: Failed opening 'nonexistant.php' for inclusion (include_path='.:/usr/share/pear5') in /path/to/test.php on line 2bool(false)

If the included file generates a hard error (E_ERROR) then execution of the script is halted and the trigger_error statement will never fire to generate a E_USER_NOTICE e.g. (a parse error):

Yes, it does. My boss gave me a book called "Working effectively with legacy code," which I find very helpful and he's also very good at programming, both in theory and practice, and understands just how much refactoring this monster needs; this isn't really one of those "I'm all alone in the world and I'm going to die and my boss doesn't understand me and oh my gods I'm going to die" WTFs. TRWTF is that I used to complain about the refactoring needed in another web application at my previous working place and now I've realized that was actually quite clean compared to this one.

We'll go open-source soon, so, if you happen to find these lines of include in a PHP application, you'll know that someone is working very hard on cleaning the spaghetti mess. The file containing them is called, of course, "includes.php"

So including over 100 files in one file which is then automatically included in every loaded page doesn't smell like a WTF to you?

I just meant, using include_once and then triggering an error as opposed to just using require_once is a WTF in addition to the WTF of including 100 or so files in one. Not trying to say that it's OK to include hundreds of files like that!

So including over 100 files in one file which is then automatically included in every loaded page doesn't smell like a WTF to you?

I just meant, using include_once and then triggering an error as opposed to just using require_once is a WTF in addition to the WTF of including 100 or so files in one. Not trying to say that it's OK to include hundreds of files like that!

Right. I must have been tired when I wrote that, now I see what you meant.