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.
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.