Feature #12058
Usage of $_ in foreach loops
| Status: | Under Review | Start date: | 2011-01-10 | ||
|---|---|---|---|---|---|
| Priority: | Should have | Due date: | |||
| Assignee: | Andy Grunwald | % Done: | 90% |
||
| Category: | Loops | Spent time: | - | ||
| Target version: | 0.0.7 | ||||
| Branch: | v4 | Tags: | |||
| Votes: | 0 |
Description
When only the key, but not the value, is of importance in a foreach loop, $_ should be used as a variable name for the value, to show that it is not used within the loop. Example:
foreach ($array as $key => $_) {
...
}
Related issues
| related to Coding Guidelines - Feature #8909: Document usage of $_ in foreach loops | Closed | 2010-07-16 |
History
Updated by Stefano Kowalke over 2 years ago
- Status changed from New to Accepted
- Target version changed from 0.0.5 to 0.0.4
Updated by Andy Grunwald about 1 year ago
- Target version changed from 0.0.4 to 0.0.5
Updated by Stefano Kowalke 9 months ago
- Target version changed from 0.0.5 to 0.0.6
Updated by Andy Grunwald 8 months ago
- Assignee set to Andy Grunwald
- Branch set to v4
Updated by Gerrit Code Review 8 months ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15653
Updated by Andy Grunwald 8 months ago
- % Done changed from 0 to 90
Updated by Stefano Kowalke about 1 month ago
- Target version changed from 0.0.6 to 0.0.7