Re: Return type hints
| From: | Arvids Godjuks | Date: | Tue, 08 Apr 2008 10:12:04 +0000 |
| Subject: | Re: Return type hints | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-36865@lists.php.net to get a copy of this message | ||
Yes it does, and not only for VB developers.
I'm plain PHP developer (with some small Pascal and Delphi background) and I
faced quite a lot situations when named parameters would give me a lot. In
stead had to write some nasty code like
myFunc($param1, $param2, array(), null, $paramX);
myFunc($param1, array(), $param4, $param5, $paramX);
And it wasn't a matter of placing function params in right order - I was
just impossible. Actual alternatives were in writing functions wrappers or
write specialized functions witch were doing the same taks, just didn't made
checks for params.
2008/4/8, Richard Quadling <rquadling@googlemail.com>:
>
> On 08/04/2008, Arvids Godjuks <arvids.godjuks@gmail.com> wrote:
> > I think type hint's would be good optional functionality. Those who need
> > will use it, others will not. I'd probably use it in some cases.
> Especially
> > if named parameters are implemented.
> >
> > Sometimes what I really want is named parameter pass like
> >
> > function myfunc(array $array, string $string = null, int $someint = 0){
> > }
> >
> > myfunc($myArray, someint = $mySomeInt);
> >
> >
>
>
> I think Named Parameters would be nice for VB developers.
>
> It makes a LOT of sense to have this I think.
>
>