Page MenuHomePhabricator

Add a lint rule forbidding use of "each()"

Authored by epriestley on Dec 9 2021, 9:55 PM.
Referenced Files
Unknown Object (File)
Sun, May 28, 10:22 PM
Unknown Object (File)
Sun, May 14, 9:11 AM
Unknown Object (File)
Sat, May 13, 12:10 PM
Unknown Object (File)
May 4 2023, 1:17 PM
Unknown Object (File)
May 2 2023, 1:58 PM
Unknown Object (File)
Apr 25 2023, 4:09 PM
Unknown Object (File)
Apr 13 2023, 4:52 AM
Unknown Object (File)
Apr 10 2023, 12:56 PM



Ref T13588. "each()" has been a bad idea for a long time, and was formally deprecated in PHP 7.2 and removed in PHP 8.0.

Catch use of "each()" in lint and reject it.

Test Plan

Added and ran unit tests.

Screen Shot 2021-12-09 at 1.53.30 PM.png (201×586 px, 62 KB)

Diff Detail

rARC Arcanist
Lint Not Applicable
Tests Not Applicable

Event Timeline

... and was formally deprecated in PHP 7.4 and removed in PHP 8.0.

The lint emitted says 7.2 (which appears to be correct), a minor inconsistency in the revision description

Ah, yep, should be 7.2 -- thanks!

This revision was not accepted when it landed; it landed in state Needs Review.Dec 9 2021, 11:59 PM
This revision was automatically updated to reflect the committed changes.