I think most of us that program in php learned to echo "string";
. While common, I am wondering why we use this so different then any other function.
So why do we do:
echo "Some String";
Instead of
echo("Some String");
And why do both exist and behave differently? Is there any reference to why this choice was made?
People refer to the php docs stating that echo is a language construct and therefor is used differently. But in that case, since we can both use it as a construct aswell as functional: which is the preferred method? And why was it implemented both ways while it should only be a language construct?
The same as above pretty much counts for require
, require_once
, include
and include_once
. I can't find anything on the web explaining -why- these constructs were also implemented functional (and in the case of echo(), in a flawed way).