jmfeurprier.com
method_exists() vs. is_callable() | Jean-Michel Feurprier
http://jmfeurprier.com/2010/01/03/method_exists-vs-is_callable
Method exists() vs. is callable(). One thing I often see when re-factoring PHP applications, is the improper use of the method exists(). Function, and I think this needs a little bit of clarification. Here is a typical example of what I’m talking about:. If (method exists($object, 'SomeMethod') { $object- SomeMethod($this, TRUE); }. Yes, but…. PHP’s method exists(). The right tool for the right job. The real intent of the previous code snippet was in fact to know if the application could call. Is part of...