July 24th, 2000, 07:54 AM
I don't know if they are or not, but do includes significantly slow down a PHP script or take CPU time on the server? In my case, I'd include a script like 20 times in a page and the include has 10 lines or so.
July 24th, 2000, 09:03 AM
It depends on whether you use includes or requires. Never use include() inside a loop as the file will be read each time the loop executes. Include()d files are read only when the code reaches the point of the include(). Require()d files are read in and basically become part of the code on the first interpreter pass so the only significant hit is the filesystem time to read the file.
Include() is good if it's inside a conditional and the file may or may not be needed depending on the conditional... as long as the conditinal is not part of a loop, otherwise stick with require().