I was working with WordPress and I required to include require_once('./blog/wp-blog-header.php'); to use WordPress functions outside WordPress when I noticed this strange behavior.
When I'm using include "file_name"
or require_once "file_name"
things are working fine, but if I try to use ()
then the rest is a blank page. no result or errors at all.
I faced the same problem earlier but I forgot how that was solve. Is there any reason behind this or this is just happening to me?
This is very weird, include
and include()
should be equivalent. Nevertheless, include
, include_once
, require
and require_once
are special language constructs not functions, parentheses are not needed (and IMHO should not be used).
For example, taken from PHP documentation:
Note: Because this is a language construct and not a function, it cannot be called using variable functions.