In my script I have a requirement where I need to redefine a PHp constant is it possible do achieve?
If you have the runkit extension installed, you can use runkit_constant_redefine():
runkit_constant_redefine
runkit_constant_redefine("name", "value");