I’m wondering if there’s any way to do the following:
function whatever($parameter)
{
echo funky_reflection_function();
}
whatever(5 == 7); // outputs "5 == 5" (not true or 1)
I’m not optimistic, but anyone know if theres any crazy hack I can do to do this?
Reflection won’t help you there, but you might be able to cook something up using debug_backtrace()
Obviously, this is very hacky and shouldn’t really be relied upon but if you’re trying to debug stuff then it might help you achieve that. That function will give you the whole line, now you have to parse it to find what was the expression used to call your
whatever()function.