As hek2mgl shows, this is not possible in PHP. Depending on why you want this to be a viable workaround.
I assume that you are trying to detect aliases created in third-party code. You could install the Runkit module , set runkit.internal_override to 1 to enable your own modification of functions, and do something similar in the root file of your project:
runkit_function_rename('class_alias', 'class_alias_internal'); function class_alias($original, $alias, $autoload = TRUE) { Logsomewhere("Creating alias from $original to $alias!"); class_alias_internal($original, $alias, $autoload); }
Of course, this also means that you can accurately make up the list you are looking for. I see no runtime use for this function (correct me if I am wrong), so you will only need to do this on the development server as much as necessary. Since Runkit is a rather dangerous module, I would even disable it on devserver as soon as you are done with it.
For other scenarios, similar workarounds may be viable, but I need to know why you are looking for this information. As for PHP, the alias must be undetectable, so it does its job perfectly (to change).
source share