You have 4 choices.
include 'yourfile.php'; include_once 'yourfile.php';
require 'yourfile.php';
require_once 'yourfile.php';
Of course, you can also use "instead."
they will all do the same, except for minor differences.
if yourfile.php does not exist, the included ones will ignore this fact, and your php page will move on - without any fatal errors.
require that they, on the other hand, create a fatal error.
if you know that this file exists, it does not matter which one you select.
As for options with postfix _once, they are usually slower compared to their missing postfixed counterparts. The reason when you use include_once or require_once, PHP will do extra work to make sure that these files are really ONCE included - protecting you from a possible double situation includes if you carelessly encode and many files use many of them, and you may encounter a situation when the same file is included twice. Well, the _once option will prevent this. And this check will come with some processing cost.
I also noticed that you used βunlikeβ for your file delimiters. There is no reason to choose "over" if you will not refer to the variable names in your files, for example
$ thefile = 'yourfile.php; include "$ thefile";
and which ones to choose from these 4? it all depends on if you think that you need to forcibly solve the _once problem, then you choose include_once or require_once, and if you think that this is not necessary, then you go with the inclusion or requirement. As for include vs require, it all comes down to the fact that you want your PHP script to die or move on if your file is unavailable for some reason.
If you are interested in learning about some speed tests, here is a link for you to check. http://php.net/manual/en/function.require-once.php
I also found this on this subject.
Understanding the Difference Between Requirement and Inclusion According to the PHP manual, requiring and including "are the same in every way, except how they handle failure." However, further reading of the manual offers another very subtle difference that affects performance. when you use the require keyword, the named file is read, parsed, and compiled, when the file using the require keyword is compiled. When a file containing the include keyword is compiled, the named file does not first read, parse, and compile. Only when this line of code is a file read, parsed, and compiled. Use only require keyword if you know that you will always need this named file in the current script. If you can use its functions, use include instead. PHP opens all the files that are required, but only included files are opened as needed. In addition, you should also consider using require_once and include_once instead of require and include, respectively. In practice, it is more likely that you really want the functionality provided by the require_once and include_once functions, although the requirement is used much more often and include keywords accordingly. See the following pages in the PHP manual for more information: include, include_once
Source: http://www.stevengould.org/portfolio/developerWorks/efficientPHP/wa-effphp/wa-effphp-a4.pdf