On Sat, January 11, 2014 16:05, Jakub Zelenka wrote:
> On Sat, Jan 11, 2014 at 2:48 PM, Anatol Belski <[email protected]> wrote:
>
>
>> the range checks is what 'L' vs 'I' would stand for, the 'L'
>> would be
>> available as alias for 'I', so one don't has to change zpp. A good
>> thing were to add type checks,
>>
>>
> Oh I see. The only small objection is that these lines could lead to the
> unexpected result from the user point of view:
>
> if (d > ZEND_INT_MAX) { *p = ZEND_INT_MAX;
> break; } else if (d < ZEND_INT_MIN) {
> *p = ZEND_INT_MIN;
> break; }
>
>
> I think that would make sense to add warning here
>
>
> Also similar checks for "s" and "p" length part (size_t -> int) would be
> great too! ;)
>
yep, that's exactly how it performs till now in the mainstream, just
replace ZEND_INT_MAX with LONG_MAX. Adding a warning to every such case
would cause a warning flood in many PHP apps, guaranteed :) Whereby it
might be ok for debug mode maybe, I wouldn't do it as I can't remember any
WTFs about the behavior.
Cheers
Anatol