May be this overflow checks should be optional?
In old ages compilers for Wirth family languages had option to enable or
disable overflow checks.
If option is enabled we may throw an exception, if no - work as today.
Any user would be able to chose between compatibility and safety.

Thanks. Dmitry.

On Thu, Sep 25, 2014 at 6:43 PM, Rowan Collins <rowan.coll...@gmail.com>
wrote:

> Andrea Faulds wrote (on 25/09/2014):
> >> No bogus value ever gets to a function - it always gets INT_MAX on
> >> > overflow. If INT_MAX is harmful for this function, this change does
> not
> >> > help as you could still pass INT_MAX and this change would not do
> anything.
> >>
> > No it won't. Normally it truncates (module), only some functions cap.
>
> I saw that in the RFC, and thought it rather odd that a more sane
> implementation already exists, but functions have to opt in to use it.
>
> I thought perhaps it was a side-effect of something else, but
> README.PARAMETER_PARSING_API doesn't list any other difference between "l"
> and "L":
>
> > l  - long (long)
> > L  - long, limits out-of-range numbers to LONG_MAX/LONG_MIN (long)
>
> What was the original motivation for functions to have that choice?
> --
> Rowan Collins
> [IMSoP]
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Reply via email to