PHP 5.2 和 5.3 版, 在 32bits 的 PHP 會有浮點數的 Bug.
看測試程式, 應該是在 (double)"2.2250738585072011e-308" 這計算過程, 會讓程式一直跑個不停, 造成機器掛掉. (純猜測, 我不敢測試. XD)
相關新聞
- PHP浮點bug會讓服務器崩潰,開發者一天內修復
- PHP Floating Point Bug Crashes Servers
- PHP floating point bug crashes servers - PCWorld
測試程式
- 下述測試程式取自: PHP 5.3.5 and 5.2.17 Released!
- 測試程式: test_bug53632.txt
此程式執行, 若有此 Bug, 會出現下述錯誤訊息:
Testing float behaviour. If this script hangs or terminates with an error message due to maximum execution time limit being reached, you should update your PHP installation asap!
For more information refer to <http://bugs.php.net/53632>.
PHP Fatal error: Maximum execution time of 1 second exceeded in - on line 35Fatal error: Maximum execution time of 1 second exceeded in - on line 35
機器正常, 沒有問題:
Testing float behaviour. If this script hangs or terminates with an error message due to maximum execution time limit being reached, you should update your PHP installation asap!
For more information refer to <http://bugs.php.net/53632>.
Your system seems to be safe.