HomePhabricator

Add a linter rule for invalid octals

Description

Add a linter rule for invalid octals

Summary: PHP doesn't handle octals very well. Basically, it seems that any numeric scalar matching /^0\d+$/ will be treated as an octal, whereas this should be /^0[0-7]+$/. As a result, 08 and 09 are both treated as 0 (because they are invalid octals. This diff adds a linter rule to detect this abnormality.

Test Plan: Added unit tests.

Reviewers: epriestley, Blessed Reviewers

Reviewed By: epriestley, Blessed Reviewers

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D14604

Details

Provenance
joshuaspenceAuthored on
joshuaspencePushed on Dec 2 2015, 9:27 PM
Reviewer
Blessed Reviewers
Differential Revision
D14604: Add a linter rule for invalid octals
Parents
rARC8ed3c45c8226: Use `CaseInsensitiveArray` in…
Branches
Unknown
Tags
Unknown
Build Status
Buildable 9234
Build 10937: Run Core Tests