viflux — 2006-08-20T21:13:18-04:00 — #1
Is it possible to undefine (or redefine would also work) a constant?
craigel — 2006-08-20T21:26:03-04:00 — #2
um, I don't think so. But if you really need to change or delete a constant, you may want to reconcider what you are using it for. Constants are just that: constant. They are never saposed to change. Just as well, a variable is just that: variable. If the value is ever saposed to change, then it is a variable.
viflux — 2006-08-20T21:32:29-04:00 — #3
Ya, I know that.
And I know that the "official" word is that it can't be done in PHP.
My situation is that an external library defines a constant that I use in my applications. I know I could just go through and change it's name to avoid conflicts, but this raised more of a theoretical question
siradrian — 2006-08-20T21:35:00-04:00 — #4
Wait until the script is finished executing.
icehawk219 — 2006-08-20T21:51:51-04:00 — #5
Once a constant is defined you are unable to re-define or un-define it. There is no way I know of to go around this.
mniessen — 2006-08-20T23:07:36-04:00 — #6
From the PHP manual:
Once a constant is defined, it can never be changed or undefined.