erros that look something like this
Fatal error: Cannot redeclare write() in ......../...
are extremely annoying, is there no one fix solution to resolve circular references rather than having to maze thru all the code files to see whats calling what?!
M
redecalre or cicular unit erros
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
If you use include_once() or require_once() instead of include() or require() for including function or class files then you should avoid the redeclare errors because the file won't be included if it has been already.
Mac
Mac
Twig, as allways(!), is correct. However, this may be indicative of a greater problem. That being that there is no clear place in your projects, scripts, webpages where included or required files are placed. I like to place all files that will be included in a script that is part of say a larger website in a configuration file. If I have a need for functionality that is common only to one script or page, then I include it at the top.
Just some ideas, but if you standardized on a way of doing things it'll most likely make you a more effecient coder.
Cheers,
BDKR
Just some ideas, but if you standardized on a way of doing things it'll most likely make you a more effecient coder.
Cheers,
BDKR