PHP is handling incorrectly my static call

前端 未结 5 1081
野趣味
野趣味 2020-12-17 05:34

I\'m havinh a problem on PHP 5.3. I need to call a method by using __callStatic, but if I use it in a instancied object, PHP call __call instead.

5条回答
  •  清歌不尽
    2020-12-17 06:14

    This is probably due to the standard notation of calling parent methods, regardless of state. You could check if the $this keyword is set in the __call method and if not, make a call to __callStatic ?

    EDIT: This isn't a bug per se, the static call is being made from an object context. Take a look at this bug thread on php.

提交回复
热议问题