我可能發現了一個錯誤,如果是這樣的話,我該如何報告呢?想到我在PHP v5.3.3-1ubuntu9.5 CLI中發現了一個錯誤?
這裏是我的本錢:
for ($i = 0; $i <= ($count)-1; ++$i) {
Lots of code...more then I want to put here
....
.....
.....
$mailto = $mailto . $i +1 . ") " . $name . " " . $location . " Type: " . $type . " Status: " . $geostatus . " Difficulty " .$difficulty . "\n" . $region . "\nHidden: " . $hidden . " Last Update: " . $lastupdate . " Last Found: " . $lastfound . "\nDistance: $distance Bearing: $bearing degrees $direction\n\n";
}
echo "$mailto \n";
輸出將是這樣的:
4) Morrow Parking - RR Relic LMBT Lat: 39.35455 Lon: -84.133733 Type: Traditional Cache Status: Active Difficulty 3
City/State: Morrow, OH Warren Co.
Hidden: Wed June 09 2010 04:00 Last Update: Wed August 03 2011 17:43 Last Found: Wed December 31 1970 19:00
Distance: 4.31 Bearing: 212 degrees SW
顯示我只有在列表中的最後一項。 但是,如果我只是稍微改變代碼如下:
for ($i = 0; $i <= ($count)-1; ++$i) {
Lots of code...more then I want to put here
....
.....
.....
$cc = $i +1;
$mailto = $mailto . $cc . ") " . $name . " " . $location . " Type: " . $type . " Status: " . $geostatus . " Difficulty " .$difficulty . "\n" . $region . "\nHidden: " . $hidden . " Last Update: " . $lastupdate . " Last Found: " . $lastfound . "\nDistance: $distance Bearing: $bearing degrees $direction\n\n";
}
echo "$mailto \n";
我得到充分的輸出,因爲我希望看到:
1) Uranus - The Solar System - Lil Miami Bike Trail Lat: 39.415517 Lon: -84.103383 Type: Traditional Cache Status: Active Difficulty 1.5
City/State: , OH Warren Co.
Hidden: Sun October 17 2010 04:00 Last Update: Fri August 05 2011 18:25 Last Found: Wed December 31 1970 19:00
Distance: 0.92 Bearing: 309 degrees NW
2) 79 Lat: 39.394517 Lon: -84.096533 Type: Traditional Cache Status: Active Difficulty 2
City/State: , OH Warren Co.
Hidden: Sun May 30 2010 04:00 Last Update: Wed August 03 2011 17:42 Last Found: Wed December 31 1970 19:00
Distance: 0.93 Bearing: 201 degrees S
3) RR Relic - Oregonia Lat: 39.462583 Lon: -84.100383 Type: Traditional Cache Status: Active Difficulty 1.5
City/State: Oregonia, OH Warren Co.
Hidden: Sun May 02 2010 04:00 Last Update: Wed August 03 2011 17:41 Last Found: Wed December 31 1970 19:00
Distance: 3.88 Bearing: 351 degrees N
4) Morrow Parking - RR Relic LMBT Lat: 39.35455 Lon: -84.133733 Type: Traditional Cache Status: Active Difficulty 3
City/State: Morrow, OH Warren Co.
Hidden: Wed June 09 2010 04:00 Last Update: Wed August 03 2011 17:43 Last Found: Wed December 31 1970 19:00
Distance: 4.31 Bearing: 212 degrees SW
我有沒有發現一個bug,還是我做錯事的第一種方式,並在第二種方式更正?
如果我確實發現了一個錯誤,我該如何報告。
PHP v5.3.3在Ubuntu 10.10上運行CLI版本謝謝。
聽起來微不足道......但你試過'$ mailto。 ($ i + 1)。# – rlemon