Difference bwt variable and constants

sry for my jargon…

this is just a newbie query…

define(‘FAVMOVIE’, ‘The Life of Brian’);

This is treated as constant as per PHP obviously…

so my question is:

Will it work as GLOBAL variable throughout my session?

can we change the value of a constant run-time? if yes then what is the use of the constant, why not using just simple variable instead?

thanks for considering my question for your expert comments/answers…

Will it work as GLOBAL variable throughout my session?

With common sense of the term “session” - no.
Dunno what you mean under GLOBAL variable though. Cause GLOBAL variables aren’t accessible throughout session too, but only SESSION variables are.

can we change the value of a constant run-time?

The answer is very simple. As well as it’s url - it is just http://php.net/constants

No, it’s a constant, not a variable.

can we change the value of a constant run-time?

No.

yes i agree…

then guys what is the purpose of the constants? if it’s not global…

what if I define a constant into a function, will it scope to be limited to that function only? or throughout the script it’ll maintain it’s assigned value?

Why don’t you either test it with 2 lines of code or read the answer from the link I provided?

Indeed.

Who said it’s not global? I said it’s not a variable.