[RFC] [Discussion] Octal overflow detection

php.internals

Sara Golemon

10 years ago
https://wiki.php.net/rfc/octal.overload-checking Because having this expression evaluate to true makes me sad: ("\000" === "\400") -Sara

Fleshgrinder

10 years ago
On 4/13/2016 4:38 AM, Sara Golemon wrote:
> https://wiki.php.net/rfc/octal.overload-checking > Because having this expression evaluate to true makes me sad: ("\000" > === "\400") > > -Sara >
+1 from my side right away. We all settled with the fact that "==" is completely useless but at least "===" should be: reflexive symmetric transitive consistent
-- Richard "Fleshgrinder" Fussenegger

Sara Golemon

10 years ago
On Tue, Apr 12, 2016 at 7:38 PM, Sara Golemon <pollita@php.net> wrote:
> https://wiki.php.net/rfc/octal.overload-checking > Because having this expression evaluate to true makes me sad: ("\000" > === "\400") >
I haven't heard any responses on this and wanted to bump it back to the top of your newsreaders. For the record, my inclination is to raise a warning on octal overflow, but not change behavior (at least, not for 7.1, perhaps later). Note that this warning would bubble up during the lexing phase, so an opcache would prevent it from raising on every page load. That's probably fine, the alternative is to signal the parser to bake it into the ast output and that's way over-engineered. -Sara

Yasuo Ohgaki

10 years ago
Hi Sara, On Tue, Apr 19, 2016 at 8:24 AM, Sara Golemon <pollita@php.net> wrote:
> On Tue, Apr 12, 2016 at 7:38 PM, Sara Golemon <pollita@php.net> wrote: >> https://wiki.php.net/rfc/octal.overload-checking >> Because having this expression evaluate to true makes me sad: ("\000" >> === "\400") >> > I haven't heard any responses on this and wanted to bump it back to > the top of your newsreaders. > > For the record, my inclination is to raise a warning on octal > overflow, but not change behavior (at least, not for 7.1, perhaps > later). > > Note that this warning would bubble up during the lexing phase, so an > opcache would prevent it from raising on every page load. That's > probably fine, the alternative is to signal the parser to bake it into > the ast output and that's way over-engineered.
I guess everyone agrees to raise warning. ("\000" === "\400") === TRUE is wrong, simply. Regards,
-- Yasuo Ohgaki yohgaki@ohgaki.net

Christoph Becker

10 years ago
On 19.04.2016 at 01:24, Sara Golemon wrote:
> On Tue, Apr 12, 2016 at 7:38 PM, Sara Golemon <pollita@php.net> wrote: >> https://wiki.php.net/rfc/octal.overload-checking >> Because having this expression evaluate to true makes me sad: ("\000" >> === "\400") >> > I haven't heard any responses on this and wanted to bump it back to > the top of your newsreaders. > > For the record, my inclination is to raise a warning on octal > overflow, but not change behavior (at least, not for 7.1, perhaps > later).
ACK. For now I have documented the issue (<https://svn.php.net/viewvc?view=revision&revision=339098>).
-- Christoph M. Becker

Björn Larsson

10 years ago
Den 2016-04-19 kl. 01:24, skrev Sara Golemon:
> On Tue, Apr 12, 2016 at 7:38 PM, Sara Golemon <pollita@php.net> wrote: >> https://wiki.php.net/rfc/octal.overload-checking >> Because having this expression evaluate to true makes me sad: ("\000" >> === "\400") >> > I haven't heard any responses on this and wanted to bump it back to > the top of your newsreaders. > > For the record, my inclination is to raise a warning on octal > overflow, but not change behavior (at least, not for 7.1, perhaps > later). > > Note that this warning would bubble up during the lexing phase, so an > opcache would prevent it from raising on every page load. That's > probably fine, the alternative is to signal the parser to bake it into > the ast output and that's way over-engineered. > > -Sara >
This reminds me a bit about the RFC: https://wiki.php.net/rfc/invalid_strings_in_arithmetic. So an E_WARNING it should be and option 2. In my opinion no deprecation is needed. Cheers //Björn