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
F13312602: D10567.diff
Tue, Jun 11, 6:46 AM
F13298806: D10567.diff
Fri, Jun 7, 7:17 AM
F13264479: D10567.id25392.diff
Mon, May 27, 5:39 PM
F13225301: D10567.diff
Sun, May 19, 2:30 PM
F13224716: D10567.id25385.diff
Sun, May 19, 10:21 AM
F13177760: D10567.diff
May 8 2024, 7:56 PM
Unknown Object (File)
Apr 25 2024, 12:38 AM
Unknown Object (File)
Apr 7 2024, 10:44 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.