Include is faster than require, not the other way around. See for example
[1] (the text is french, but you'll get the performance difference.), it
shows include is about 38% faster on 1000 includes.

I also don't think require includes files before the script is run, because
PHP is a dynamic language, and you might do things like include
$somevar.".php"; or require $somevar.".php"; which can only be done when
PHP knows what somevar will be. Note that I do absolutly recommend NOT to
use variables for including, as it leads to possible security issues,
especially when the var is related to user input.

As of how to use it, I'd say read the PHP manual [2], but it is as simple
as replacing the word include with require.

- Matijn


On Sat, Nov 10, 2012 at 5:38 PM, andrej arshinow <>wrote:

> I knew that before the function require a faster because All files are
> included before run the script. Now is this? And how to use it?

Reply via email to