Re: Type hints with null default values
| From: | Markus Fischer | Date: | Tue, 19 Oct 2004 07:45:14 +0000 |
| Subject: | Re: Type hints with null default values | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-13388@lists.php.net to get a copy of this message | ||
Marcus Boerger wrote:
While [] is a nice idea for the remaining problem allowing multiple types is a very bad idea. Instead you should use Interfaces and finally learn that neither will we allow basetypes as typehints nor is null a type. Which brings me back to my opinion that you should fix your code and find a way to live with typehints as they are. Their usage means you can rely on the fact that a certain class type or interface is present. That means i could agree to have a way to mark typehinted values as optional but i won't live with allowing to pass null values.While still nothing is carved in stone, what is you opinion how an error (object of wrong class/instance or no object) passed) should be handled by the engine? Exception or zend_error (fatal?) ? thanks, - Markus