In the official php Manual, "once a constant is defined, it cannot be changed or undefined ". But why can this value change form be defined in the program? In the official php Manual {code...}, "once a constant is defined, it cannot be changed or undefined ".
But why can this value change form be defined in the program?
Define ("MESSAGE", time (); // returns the constant echo MESSAGE;
Reply content:
In the official php Manual, "once a constant is defined, it cannot be changed or undefined ".
But why can this value change form be defined in the program?
Define ("MESSAGE", time (); // returns the constant echo MESSAGE;
In terms of syntax, there is no error. the changes mentioned in the manual emphasize human changes in the future, including cancellation.
Here, the MESSAGE you want to express is variable. it can be understood that php finds the time () result in the memory during running.
I guess this should be related to functional programming. The time () function can be assigned to a constant. accessing a constant is equivalent to accessing the time () function, and the return value of the time () function is constantly changing.
Once a constant is defined, it cannot be changed or undefined.
Then you can try to change the MESSAGE,
For example, MESSAGE + = 1;
It seems that this is a function connected to time!