Re: Q on Primitives
| From: | Nathan Rixham | Date: | Thu, 18 Dec 2008 14:14:46 +0000 |
| Subject: | Re: Q on Primitives | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-42334@lists.php.net to get a copy of this message | ||
2008/12/18 Dave Ingram <dave@dmi.me.uk>
>
> Also, what about this case:
>
> class MyTestClass {
> public function blah(Foo $f);
> public function blah(Bar $b);
> public function blah($v);
> }
>
> I would argue that the most specific function should be called, but how
> costly would that be to determine? What if you have a "Baz" subclass of
> Bar, but no corresponding method? What if Bar itself is a subclass of Foo?
>
>
Ideally a most specific first approach, failing that I'd suggest taking
doing it the nearest first way (like we do when catching exceptions) ?