On 24 May 2010 13:09, Zeev Suraski <z...@zend.com> wrote: > 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.
Given this is a new feature, my preference is #1, with the addition of the scalar and numeric hints mentioned upthread for less strict checking. I see scalar type hinting as a way of saying "I want a variable of type X", not "I want a variable that may have been lossily coerced into type X"; the developers mentioned in the RFC who are presently unaware of PHP's typing system strike me as being unlikely to use type hinting regardless of how it's implemented. That said, I don't think #3 would be the end of the world, either. My vote is admittedly a little selfish; it just doesn't line up as well as #1 with what I'd actually want to use scalar type hinting for. Adam -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php