I am using this code (note: HELLO_WORLD was NEVER defined!):
function my_function($Foo) {
//...
}
my_function(HELLO_WORLD);
HELLO_WORLD
might be defined, it might not. I want to know if it was passed and if HELLO_WORLD
was passed assuming it was as constant. I don't care about the value of HELLO_WORLD
.
Something like this:
function my_function($Foo) {
if (was_passed_as_constant($Foo)) {
//Do something...
}
}
How can I tell if a parameter was passed assuming it was a constant or just variable?
I know it's not great programming, but it's what I'd like to do.