Redefining constants in PHP

If you have the runkit extension installed, you can use runkit_constant_redefine():

runkit_constant_redefine("name", "value");

In most circumstances, however, it would be a better idea to re-evaluate why you’re using constants and not something more fitting.

Leave a Comment