PHP __call vs method_exists

前端 未结 5 1057
花落未央
花落未央 2020-12-18 21:55

The Project I\'m working on contains something like a wrapper for call_user_func(_array) which does some checks before execution. One of those checks is method_exists (In Ca

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-18 21:59

    I'd be tempted to maybe use method_exists in your __call function and throw an Exception should this fail and wrap everything in a try catch block instead of using the is_callable function.

提交回复
热议问题