Browse Source

Do not iterate by reference

Iteration by reference is generally only used when the variable is
changed and that change should be reflected in the array. Whether
this is faster or not is irrelevant since this is a realistic
implementation.
Levi Morrison 9 years ago
parent
commit
276ddaaf86
1 changed files with 1 additions and 1 deletions
  1. 1 1
      frameworks/PHP/php/fortune.php

+ 1 - 1
frameworks/PHP/php/fortune.php

@@ -30,7 +30,7 @@ asort($arr);
 <th>message</th>
 </tr>
 <?php
-foreach ( $arr as $id => &$fortune ) {
+foreach ( $arr as $id => $fortune ) {
 ?>
 <tr>
 <td><?php echo htmlspecialchars($id, ENT_QUOTES, 'UTF-8'); ?></td>