When do/should I use __construct(), __get(), __set(), and __call() in PHP?

后端 未结 10 729
再見小時候
再見小時候 2020-12-05 08:16

A similar question discusses __construct, but I left it in my title for people searching who find this one.

Apparently, __get and __set take a parameter that is the

10条回答
  •  我在风中等你
    2020-12-05 09:15

    I think it is bad for design you code. If you know and do a good design then you will not need to use the __set() and __get() within your code. Also reading your code is very important and if you are using studio (e.g. Zend studio), with __set() and __get() you can't see your class properties.

提交回复
热议问题