require_once at the beginning or when really needed?
Posted
by takeshin
on Stack Overflow
See other posts from Stack Overflow
or by takeshin
Published on 2010-03-16T14:57:10Z
Indexed on
2010/03/16
15:01 UTC
Read the original article
Hit count: 189
Where should I put require_once
statements, and why?
- Always on the beginning of a file, before the class,
- In the actual method when the file is really needed
- It depends
- ?
Most frameworks put includes at the beginning and do not care if the file is really needed.
Using autoloader is the other case here.
© Stack Overflow or respective owner