Page MenuHomePhabricator

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

Authored by joshuaspence on Sep 25 2014, 9:47 PM.
Tags
None
Referenced Files
F15434430: D10567.id25392.diff
Tue, Mar 25, 3:38 AM
F15428766: D10567.id25390.diff
Sun, Mar 23, 10:13 PM
F15428727: D10567.id25385.diff
Sun, Mar 23, 9:56 PM
F15422354: D10567.diff
Sat, Mar 22, 7:35 AM
F15413661: D10567.diff
Wed, Mar 19, 8:23 PM
F15403617: D10567.diff
Tue, Mar 18, 4:08 AM
F15393072: D10567.id25390.diff
Sat, Mar 15, 7:25 PM
F15389451: D10567.diff
Sat, Mar 15, 5:15 AM
Subscribers

Details

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.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

joshuaspence retitled this revision from to Add a linter rule to detect variable arguments for `break` and `continue`.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.
This revision is now accepted and ready to land.Sep 25 2014, 9:50 PM
joshuaspence edited edge metadata.

Add test cases for continue

This revision was automatically updated to reflect the committed changes.