在 PHP 中以两个下划线开头的方法,__construct(), __destruct (), __call(), __callStatic(),__get(), __set(), __isset(), __unset (), __sleep(), __wakeup(), __toString(), __set_state,() __clone() __autoload()等,被称为"魔术方法"(Magic methods)。
可以在一个类中为各种不同的动作创建这些魔术方法。
You can create these magic methods in a class for a variety of action types.
PHP V5提供了一些可用于类内部的特别定义的方法,称为魔术方法。
PHP V5 has several specially defined methods that can be used inside classes known as magic methods.
种,(但不是真的),怎么像是用魔术方法__如构造函数方法。
Kind of, (but not really), like how the __ is used with magic methods such as the constructor method.
应用推荐