# [RFC] [Discussion] Octal overflow detection

- Thread: https://externals.io/message/92238
- Original archive: https://news-web.php.net/php.internals/92238
- Started by Sara Golemon on 2016-04-13T02:38:12+00:00
- Messages: 6
- RFC: Octal Overflow Protection (Implemented (PHP 7.1)) — https://externals.io/rfc/octal.overload-checking.md
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #92238 — Sara Golemon — 2016-04-13T02:38:12+00:00

URL: https://externals.io/message/92238#92238

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

-Sara

---

## #92254 — Fleshgrinder — 2016-04-13T17:44:44+00:00

URL: https://externals.io/message/92238#92254 · In reply to: #92238

> 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

---

## #92431 — Sara Golemon — 2016-04-18T23:24:09+00:00

URL: https://externals.io/message/92238#92431 · In reply to: #92238

> 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

---

## #92768 — Yasuo Ohgaki — 2016-04-26T08:18:27+00:00

URL: https://externals.io/message/92238#92768 · In reply to: #92431

Hi Sara,


> 
> > […]
> 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

---

## #92775 — Christoph Becker — 2016-04-26T09:49:25+00:00

URL: https://externals.io/message/92238#92775 · In reply to: #92431

> 
> > […]
> 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

---

## #92810 — bjorn.x.larsson@telia.com — 2016-04-26T17:49:43+00:00

URL: https://externals.io/message/92238#92810 · In reply to: #92431

Den 2016-04-19 kl. 01:24, skrev Sara Golemon:
> 
> > […]
> 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
