2008/12/18 Dave Ingram <d...@dmi.me.uk> > Nathan Rixham wrote: > > [...] > > > > while I'm here I may as well also ask about further adding type > > hinting for the existing scalars and array. > +1, but I don't know what might have stopped it being implemented before > (time, parsing API changes, etc), so it would be interesting to look > into the history. >
This is simple to achieve with assert('is_string($argument)'); 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? > I remember that multiple signatures was said to have a possible very difficult implementation. However, a similar behaviour can be achieved by some instanceof(). -- Giorgio Sironi Piccolo Principe & Ossigeno Scripter http://www.sourceforge.net/projects/ossigeno