I've noticed that the trend is to define global variables just by doing:
$MYVAR = "something";
in an include file, for instance. However, why not use:
define ("MYVAR", "something");
Is there a reason that people tend to shy away from define() or is there a reason for not using it ?
The only reason I can think of is that constants (as far as I know) can't be evaluated within double-quoted strings, you have to do:
echo "here is my variable: " . MYVAR;
instead of
echo "here is my variable: $MYVAR";
Wouldn't it make sense to use constants for variables that are not to be changed anywhere else in the script? Is this just a matter of preference?