PHP 4.0 Bug #2676: min() and max() behavior changed?
| From: | leon at leonatkinson dot com | Date: | Sun, 07 Nov 1999 01:57:06 +0000 |
| Subject: | PHP 4.0 Bug #2676: min() and max() behavior changed? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-12185@lists.php.net to get a copy of this message | ||
From: leon@leonatkinson.com
Operating system: windows
PHP version: 4.0 Beta 2
PHP Bug Type: Misbehaving function
Bug description: min() and max() behavior changed?
<?
print(min(1, 17, 3, 5.5, "hello") . "<BR>\n");
print(max(1, 17, 3, 5.5, "hello") . "<BR>\n");
?>
Under PHP 3.0.12 this generates:
1
hello
Under PHP 4b2 this generates:
hello
17
It looks like min and max are always comparing elements by their double value. If there are any
string values in the list, the comparison should be made alphabetically.