PHP Bugs  
php.net | support | documentation | report a bug | advanced search | search howto | statistics | login

go to bug id or search bugs for  

Bug #2676 min() and max() behavior changed?
Submitted:6 Nov 1999 8:57pm UTC Modified: 22 Nov 1999 8:29pm UTC
From:leon at leonatkinson dot com Assigned to:
Status:Closed Category:Misbehaving function
Version:4.0 Beta 2 OS:windows
View/Vote Developer Edit Submission

[6 Nov 1999 8:57pm UTC] leon at leonatkinson dot com
<?
  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.

[22 Nov 1999 8:29pm UTC] andrei at cvs dot php dot net
This was fixed for Beta 3.

RSS feed | show source 

PHP Copyright © 2001-2009 The PHP Group
All rights reserved.
Last updated: Sat Nov 21 10:30:49 2009 UTC