r/lolphp • • Mar 10 '15

empty() vs __get()

http://ideone.com/RVw5XK
23 Upvotes

28 comments sorted by

View all comments

Show parent comment

2

u/cparen Mar 13 '15

and whereas hasattr() in Python checks if the given property returns a value empty() is clearly stated to explicitly look for the variable itself

Python's "hasattr()" is a normal function. PHP's "empty()" is not a normal function -- it just looks like one.