Require vs. include – for _once and for all

Require has to have the file, if not it gives an error.

Include – wants the file, gives a warning if it is not there, but continues running.

_once means that for the entire run of the current script / file – do not fetch this file more than once (also in other included files).  More efficient and could prevent errors of declaring a function / class more than once.

Leave a Reply

Your email address will not be published. Required fields are marked *