Page MenuHomePhorge

reused-iterators.lint-test
No OneTemporary

reused-iterators.lint-test

<?php
for ($ii = 0; $ii < $len; $ii++) {
foreach ($list as $ii => $jj) {
// Reuse of $ii.
}
}
for ($jj = 0; $jj < $len; $jj++) {
foreach ($list as $jj) {
// Reuse of $jj.
}
}
for ($ii = 0; $ii < $len; $ii++) {
foreach ($list as $ii => &$jj) {
// Reuse of $ii.
}
}
for ($jj = 0; $jj < $len; $jj++) {
foreach ($list as &$jj) {
// Reuse of $jj (by reference).
}
}
for ($ii = 0; $ii < $len; $ii++) {
for ($jj = 0; $jj < $len; $jj++) {
foreach ($list as $kk) {
// No reuse.
}
}
}
for ($ii = 0; $ii < $len; $ii++) {
for ($ii = 0; $ii < $len; $ii++) {
// Reuse of $ii, pure for loops.
}
}
for ($ii = 0; $ii < $len; $ii++) {
for ($jj = $ii; $jj < $jjlen; $jj++) {
// No reuse.
}
}
foreach ($list as $thing) {
for ($thing = 0; $thing < $len; $thing++) {
// Reuse of $thing, for within foreach.
}
}
~~~~~~~~~~
error:4:11
error:10:11
error:16:11
error:22:11
error:36:7
error:48:7

File Metadata

Mime Type
text/x-php
Expires
Sun, Jan 19, 12:22 (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1124510
Default Alt Text
reused-iterators.lint-test (951 B)

Event Timeline