Is this just a stylistic difference, or does using require_once('filename.php')
vs require_once 'filename.php'
have actual load/efficiency differences?
views:
115answers:
3
+2
A:
What does your heart tell you?
Performance difference, if any: negligible.
Mchl
2010-08-03 05:39:16
+6
A:
It's exactly the same thing. It's a matter of style.
The parentheses may get in the way some times. For instance, this example from the manual doesn't do what you expect:
if (include('vars.php') == 'OK') {
echo 'OK';
}
See example #4.
Artefacto
2010-08-03 05:39:27
But this is not caused by the parentheses.
Gumbo
2010-08-03 05:57:53
@Gumbo It isn't, but it induces you in error.
Artefacto
2010-08-03 21:49:28
+4
A:
There is no difference. I don't use the brackets 'cause they are not necessary. require_once is no function.
alopix
2010-08-03 05:40:12