[RFC] Add support for explicit octal notation for integer literals

php.internals

Girgias

5 years ago
Hello internals, A rather short RFC about adding support for the "0o" prefix for octal integers. https://wiki.php.net/rfc/explicit_octal_notation Surprisingly PHP already accepts the prefix within octdec() and base_convert(). I have hopefully covered all the cases where this may apply but if you find another one please let me know. Best regards George P. Banyard

Sara Golemon

5 years ago
On Wed, Oct 21, 2020 at 9:59 AM G. P. B. <george.banyard@gmail.com> wrote:
> A rather short RFC about adding support for the "0o" prefix for octal > integers. > https://wiki.php.net/rfc/explicit_octal_notation > > Surprisingly PHP already accepts the prefix within octdec() and > base_convert(). > > I have hopefully covered all the cases where this may apply but if you find > another one please let me know. > >
+1 As for deprecating the old syntax in the future, I'd be in favor of that. I've been bit by this subtle number format a couple of times and writing a tool to auto-convert to the new format is trivial. Here's about 3 minutes worth of effort, for example: https://gist.github.com/sgolemon/6f9fbb3a95352cbab9297319022d19a5 -Sara

Nikita Popov

5 years ago
On Wed, Oct 21, 2020 at 4:59 PM G. P. B. <george.banyard@gmail.com> wrote:
> Hello internals, > > A rather short RFC about adding support for the "0o" prefix for octal > integers. > https://wiki.php.net/rfc/explicit_octal_notation > > Surprisingly PHP already accepts the prefix within octdec() and > base_convert(). > > I have hopefully covered all the cases where this may apply but if you find > another one please let me know. > > Best regards > > George P. Banyard >
Fully support this proposal. Nikita

Girgias

5 years ago
Hello internals, As the 2 week discussion period has passed I intend to open voting on Tuesday the 10th of November. I did a bit of rewording on the RFC but it is fundamentally identical: https://wiki.php.net/rfc/explicit_octal_notation Any remaining concerns, clarifications and/or questions should preferably be asked before Tuesday. Best regards, George P. Banyard