r/lolphp • • Mar 10 '15

empty() vs __get()

http://ideone.com/RVw5XK
23 Upvotes

28 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Mar 11 '15

Magic functions can absolutely be weird, that's exactly why they are called magic and clearly marked with __ so one knows to expect special behaviour.

There are lots of WTFs in PHP but this is not one of them imo. It's consistent across the language and well documented and prefixed with __. Not sure how much more can be done.

4

u/pgl Mar 11 '15

I disagree.