Why is require_once so bad to use?

This thread makes me cringe, because there’s already been a “solution posted”, and it’s, for all intents and purposes, wrong. Let’s enumerate: Defines are really expensive in PHP. You can look it up or test it yourself, but the only efficient way of defining a global constant in PHP is via an extension. (Class constants … Read more

Difference between require, include, require_once and include_once?

There are require and include_once as well. So your question should be… When should I use require vs. include? When should I use require_once vs. require The answer to 1 is described here. The require() function is identical to include(), except that it handles errors differently. If an error occurs, the include() function generates a … Read more