Re: Type hinting
| From: | Dmitry Stogov | Date: | Mon, 24 May 2010 15:57:53 +0000 |
| Subject: | Re: Type hinting | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-48435@lists.php.net to get a copy of this message | ||
Stas Malyshev wrote:
Hi!In case we remove 'Array->scalar' and others everywhere, #3 would be the same as #2. I'm for that. Thanks. Dmitry.I see three key options going forward: 1. Implement the table along the lines of what it looks like now, perhaps with minor changes. 2. Implement identical conversion rules to the ones that exist in PHP; That effectively turns type hinting into scalar casting operators (not saying that's a bad thing!) 3. Implement identical conversion rules to the ones that exist in PHP, except for when they really suck. Namely, lose the array->scalar conversions and silent conversions of non-numeric strings to numbers.I'm for 3, Array->scalar must die, as for non-numeric to numbers, I don't have strong opinion as I see no point in it, IMO if it failed, I'd be OK with it.