HomePhabricator

Add a linter rule to detect variable arguments for `break` and `continue`

Description

Add a linter rule to detect variable arguments for break and continue

Summary: In PHP 5.4, the break and continue statements no longer accept variable arguments (e.g., break 1 + foo() * $bar;). Static arguments still work, such as break 2;. As a side effect of this change break 0; and continue 0; are no longer allowed.

Test Plan: Added some test cases.

Reviewers: epriestley, Blessed Reviewers

Reviewed By: epriestley, Blessed Reviewers

Subscribers: epriestley, Korvin

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

Details

Provenance
joshuaspenceAuthored on
joshuaspencePushed on Sep 25 2014, 10:43 PM
Reviewer
Blessed Reviewers
Differential Revision
D10567: Add a linter rule to detect variable arguments for `break` and `continue`
Parents
rARC247a4fabb8b6: Fix `LINT_ARRAY_SEPARATOR` for heredocs
Branches
Unknown
Tags
Unknown

Event Timeline