__construct(), __destruct(), __call(), __callStatic(), __get(), __set(), __isset(), __unset(), __sleep(), __wakeup(), __toString(), __invoke(), __set_state(), __clone() 和 __debugInfo() 等方法在 PHP 中被称为“魔术方法”(Magic methods)。在命名自己的类方法时不能使用这些方法名,除非是想使用其魔术功能。
1、__construct() 和 __destruct()
2、__sleep() 和 __wakeup()
3、
博客介绍了PHP中的“魔术方法”,如__construct()、__destruct()等。在命名类方法时,除非想使用其魔术功能,否则不能使用这些方法名,还列举了部分魔术方法组合,如__construct()和__destruct()、__sleep()和__wakeup()。
421

被折叠的 条评论
为什么被折叠?



