Kaynağa Gözat

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 yıl önce
ebeveyn
işleme
276ddaaf86
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  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>