Re: Type hints with null default values
| From: | Curt Zirzow | Date: | Fri, 29 Oct 2004 23:29:01 +0000 |
| Subject: | Re: Type hints with null default values | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-13613@lists.php.net to get a copy of this message | ||
* Thus wrote Christian Schneider:
> Please don't add another parameter syntax (especially with line-noi...
> err special characters) like [BaseClass]. This would make PHP more
> unreadable than it needs to be for a minor feature. To allow
> foo(BaseClass $objA = null) to also accept foo(null); handles the few
> cases where you want to pass null nicely IMHO.
I'd have to agree, that changing the syntax on how to pass optional
class type hints, is probably not a good thing to do. It has been
traditional to set a parameter to default by assigning a value to
the paramater, and the rule always has been what kind of value can
be assigned.
Curt
--
Quoth the Raven, "Nevermore."