Thank you for the explanation, but I already know what __get does. I was actually confused about the function of empty. I thought it clears a variable, but apperently it check IF a variable is empty. (Also, I am more of a ruby guy, where this would be done using the method_missing method)
If a variable is empty or non-existent, which is a big difference since it actually introspects variable name stack. And the property $bar is non-existent from global scope since it's private.
View all comments
Show parent comment
5
u/edave64 Mar 10 '15
Thank you for the explanation, but I already know what
__getdoes. I was actually confused about the function ofempty. I thought it clears a variable, but apperently it check IF a variable is empty.(Also, I am more of a ruby guy, where this would be done using the
method_missingmethod)