Re: [RFC] Type hints

From: Date: Tue, 11 May 2004 12:55:14 +0000
Subject: Re: [RFC] Type hints
References: 1 2 3 4 5 6 7 8 9 10 11 12 13  Groups: php.internals 
Request: Send a blank email to internals+get-9812@lists.php.net to get a copy of this message
On Tue, 2004-05-11 at 14:23, Andi Gutmans wrote: > At 11:44 AM 5/11/2004 +0200, Timm Friebe wrote: [...] > >Will this affect optional arguments? I.e., will the following still > >work? [...] > Nope, why would it work? If we make the type hint strict (which I think we > should) then you can't define it to NULL. > Doing so would be kind of inconsistent. Aren't optional parameters and allowing NULL for typehints two different pairs of shoes? At least passing NO parameters and NULL as parameter is easily distinguishable in userland: $ php -r 'function test() { var_dump(func_num_args()); } test();' int(0) $ php -r 'function test() { var_dump(func_num_args()); } test(NULL);' int(1) - Timm

« previous php.internals (#9812) next »