Thread: PHP Question
View Single Post
Old 05-16-07, 01:37 PM   #10
Ngemu Mod
Join Date: Jul 2003
Location: Fresno, CA
Posts: 1,886
Default Re: PHP Question

Originally Posted by evilghost
Exactly, IMHO it would be poor coding to include the function more than once. I could see a use for require_once() in a conditional but in this case I would assume require() would be more fitting with the file inclusion occurring at the "top" of the code outside of any conditional.
I've found that once you start programming in OOP with PHP. It can get messy when multiple classes requires the same functions/classes from other php files, but you needed to use both classes on one page. For example:

All objects(classes) are defined on different php scripts:
Object 1 requires object2;
Object 3 requires object2;

Your page requires object1, object2, and object3. Using only require('xx.php') would cause errors. I guess it would depend on what you're trying to do though.
[i7 2600k @4.4ghertz][2x4 GB DDR3 1600][EVGA GTX570 1.280GB SC][EVGA GTX460 physx][Asrock Extreme7 Gen3 Z68][2xSeagate 160 Gb SATA HD raid0][Seagate 250 GB SATA2 HD][Sony Bravia 40' 1080p LCD HDTV][NEC 3520a DVD+-DLw][Windows 7 Ultimate x64][Rosewill 1000w]
fivefeet8 is offline   Reply With Quote