Chances are, if you’ve looked at PHP code, you’ve encountered magic methods — you can tell it is a magic method because the method is preceded by two underscores. If you’re not using these tools, you should be. Magic methods are functions that allow you to show an object how to react when something happens to it. You get to define how your object should react in an event. This can be a huge tool in preventing errors and reducing redundant code. In this article, I am going to introduce you to some of the magic methods that PHP provides. […]
1 Comment
Join the conversation