On Fri, March 9, 2012 2:51 am, Nikita Popov wrote:
> On Fri, Mar 9, 2012 at 3:58 AM, Ilia Alshanetsky <i...@prohost.org>
> wrote:
>> Anthony,
>>
>> My concern with this type of patch is that what you are proposing
>> are
>> not really hints, they are forced casts. As such they modify the
>> data
>> potentially leading to data loss.
> This patch specifically tries to overcome this problem of the previous
> version. It will not accept input which will lead to a data loss on
> cast. The only exception is passing "123abc" to an int hint, which
> will cast to 123 and throw a notice. This is also my only point of
> critique: I'd prefer to be stricter here and go all the way to a
> recoverable fatal error.

So what happens to (int) "1233553463645747675685685"

Does it cast and then cause an overflow, which PHP pretty much ignores
and wraps to a negative number?

Or does it error out as you can't convert without mangling the data?

Will it behave differently on 32-bit versus 64-bit hardware for values
that are in-range of 64 but no 32?

-- 
brain cancer update:
http://richardlynch.blogspot.com/search/label/brain%20tumor
Donate:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FS9NLTNEEKWBE



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to