Glossary

PHP Magic Methods

Magic methods are special double-underscore methods (__method) that PHP calls automatically during certain operations on an object. They allow you to override the default behaviour of a class.

Most important

Caution

Magic methods are slower than regular ones. __get/__set hinder static analysis — the IDE cannot "see" the properties. Use them only where dynamic behaviour is genuinely needed.