A note to the unknown coder - Grin with cat attached
Previous Entry Next Entry
A note to the unknown coder Jan. 8th, 2004 04:23 pm
include(); is *not* a suitable substitute for a function call.

From: mageboltrat
Date: January 8th, 2004 - 08:27 am (Link)
er... what??

That's almost as good as my call to vyvyan which was..

Tell Graham March the 4th is nowhere near Whitby.
From: deliberateblank
Date: January 8th, 2004 - 09:45 am (Link)
One thing I'm not entirely clear on - I've tried to split out large sections of funtions into separate include files since they're generally needed in some pages and not others and it makes the codebase a hell of a lot easier to manage. But does PHP (mod_php4) cache included files across page fetches? It ought to be able to, but... (Well, the database hits are probably far more expensive than a few file read/parse cycles, but it'd be nice to know it's not gratuitously inefficient.)

There are worse problems with include()/require() than people using them too much. The default of url_fopen_wrappers on is pretty stupid, and in conjunction with people (stupidly) turning on register_globals or using old versions of PHP where it was the default has led to several compromises.
From: mageboltrat
Date: January 8th, 2004 - 10:48 am (Link)
Ah now I understand the comment... Yep I agree include() is great for code bases, it's also damn good for standard table headers and so on. Using include for everydamn thing... Nope not a good idea.