Re: Re: Exceptions instead of Fatal Error when calling non existent method?
| From: | Mikko Koppanen | Date: | Mon, 31 Dec 2007 11:58:44 +0000 |
| Subject: | Re: Re: Exceptions instead of Fatal Error when calling non existent method? | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-34293@lists.php.net to get a copy of this message | ||
> Yes, I'm aware of call() but it's very slow. Also it's not feasible to
> have
> *all* my classes extend a base class with the a call containing a throw
> InvalidMethodException, and what if I need to use 3rd party libraries that
> make use of call in some other way. __call() is a hack, that, at best,
> work
> 50% of the time.
>
Calling methods without knowing that they exist sounds like a hack to me.
How about using abstract classes or interfaces?
--
Mikko Koppanen