As it turns out I will be having to call get_defined_vars()
quite a lot in different classes and files. I don't like the particular looks of this function name, so I want to rename it to something simpler like variables()
or vars()
.
I've done some reading and I learned that I can "import" it with an alias within a namespace.
use function \get_defined_vars as variables;
But that means I will have to be aliasing in every file for this to work. I was wondering - is there any way I could alias the function globally so it would be callable from anywhere with this alias?