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
F13177760: D10567.diff
Wed, May 8, 7:56 PM
Unknown Object (File)
Thu, Apr 25, 12:38 AM
Unknown Object (File)
Apr 7 2024, 10:44 AM
Unknown Object (File)
Mar 28 2024, 6:21 PM
Unknown Object (File)
Mar 21 2024, 1:08 AM
Unknown Object (File)
Feb 16 2024, 11:22 AM
Unknown Object (File)
Feb 4 2024, 4:16 PM
Unknown Object (File)
Dec 25 2023, 9:57 PM
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.