Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2(PHP_5_1) /zend_compile.c
From: Andi Gutmans Date: Fri, 18 Nov 2005 22:52:56 +0000 Subject: Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2(PHP_5_1) /zend_compile.c References: 1 2 3 4 Groups: php.zend-engine.cvs Request: Send a blank email to [email protected] to get a copy of this message
I wasn't thinking about it from a purist language design point of view. It just seemed to me to be mixing apples and oranges. If someone indeed wants to use default params with array typehints, then at least we should make sure he has a true array so that he can use it without warnings in any array/foreach whatever function. is_array() should be true. I just think this isn't consistent. At 02:40 PM 11/18/2005, Marcus Boerger wrote:Hello Andi, Friday, November 18, 2005, 8:30:09 PM, you wrote: At 11:51 PM 11/17/2005, Dmitry Stogov wrote:It's not a valid array value. That's a very purist oppinion and somehow contradicts php's kiss approach. In th ebeginning i was against this too. Just because language design theory would forbit this (unless we have a syntax to explicitly allow null too). However a lot of users want this and even though those designs are probably considered very bad from any university it seems to help them.I don't see any reason not allow null as default value for arguments with array type hint.Oh you refer to stipped down languages like Java? regards marcusIn real OOP languages "array" just a special class.
Thread (19 messages)
« previous | php.zend-engine.cvs (#4367) | next » |
---|