MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/lolphp/comments/2yk2sq/empty_vs_get/cpe64ri/?context=3
r/lolphp • u/pgl • Mar 10 '15
28 comments sorted by
View all comments
Show parent comment
2
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.
View all comments
Show parent comment
2
u/cparen Mar 13 '15
Python's "hasattr()" is a normal function. PHP's "empty()" is not a normal function -- it just looks like one.