PHP 手冊
上一頁 | 附錄 C.Migrating from PHP 3 to PHP 4 | 下一頁

# empty("0")

The perhaps most controversial change in behavior has happened to the behavior of the empty(). A String containing only the character '0' (zero) is now considered empty while it wasn't in PHP 3.

This new behavior makes sense in web applications, with all input fields returning strings even if numeric input is requested, and with PHP's capabilities of automatic type conversion. But on the other hand it might break your code in a rather subtle way, leading to misbehavior that is hard to track down if you do not know about what to look for.

上一頁 | 最開頭 | 下一頁
Initializers | 上一層 | Missing functions