I don't get when one would use magic methods. if I use them when i need to do complex operations, why would I not use a function that I define? thanks | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I don't get when one would use magic methods. if I use them when i need to do complex operations, why would I not use a function that I define? thanks

10th Aug 2016, 1:27 PM
Davide Polizzi
Davide Polizzi - avatar
2 Answers
+ 2
Be careful. We are talking about methods,not functions. So a magic method allows you to make complex operations on Objects,not only variables!
14th Aug 2016, 4:05 PM
Alessandro Censi
Alessandro Censi - avatar
0
thanks
14th Aug 2016, 4:07 PM
Davide Polizzi
Davide Polizzi - avatar