What are the differences between all of these:
require()
require_once()
include()
include_once()
Printable View
What are the differences between all of these:
require()
require_once()
include()
include_once()
they differ in how they handle errors....
When using object orientated design you should always use include_once/require_once as they prevent the same code from potentially being evaluated twice.
Additionally, if a class is named in the code and not defined, if you define a function called __autoinclude you have a last chance possibility to load the class yourself. This avoids having to keep track of all the require_once statements in your files.