Is include()/require() with “side effects” a bad practice?

Yes, IMHO it’s (very) bad practice unless very explicitly documented.

include or require (and their equivalents in other languages) should normally only introduce new functions into the current scope, and never trigger their invocation.

Leave a Comment