PHP & OOP: Magic Methods

This entry is part 11 of 11 in the series PHP & OOP

We have used __construct and __destruct in an earlier example.  These are called magical methods in PHP.

PHP reserves all function names starting with __ as magical. It is recommended that we do not use function names with __ in PHP.

Other magical functions are:













and __clone().


Series Navigation<< PHP & OOP: Method visibility

Leave a comment

Leave a Reply