Pergunta de entrevista da empresa KDK Software

1. require_once(), require(), include().What is difference between them?

Resposta da entrevista

Sigiloso

13 de jun. de 2017

require() includes and evaluates a specific file, while require_once() does that only if it has not been included before (on the same page). So, require_once() is recommended to use when you want to include a file where you have a lot of functions for example. This way you make sure you don't include the file more times and you will not get the "function re-declared" error.