Page MenuHomePhabricator

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

Authored by epriestley on Dec 9 2021, 9:55 PM.
Tags
None
Referenced Files
F15572998: D21741.id51813.diff
Mon, May 5, 6:42 PM
F15522061: D21741.id.diff
Sun, Apr 20, 5:57 PM
F15502870: D21741.id51813.diff
Mon, Apr 14, 5:08 AM
F15492530: D21741.id51814.diff
Sat, Apr 12, 3:30 PM
F15490501: D21741.id.diff
Fri, Apr 11, 5:59 PM
F15487466: D21741.diff
Thu, Apr 10, 2:18 PM
F15477221: D21741.diff
Mon, Apr 7, 1:03 PM
F15463831: D21741.id51814.diff
Apr 2 2025, 3:46 AM
Subscribers

Details

Summary

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

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
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.