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

go to bug id or search bugs for  

Bug #22565 max not returning a number
Submitted:6 Mar 2003 12:06am UTC Modified: 18 Jul 2003 8:05pm UTC
From:csaba at alum dot mit dot edu Assigned to:
Status:Closed Category:Documentation problem
Version:4.3.0 OS:All
View/Vote Developer Edit Submission

Welcome! If you don't have a SVN account, you can't do anything here. You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
SVN Username: SVN Password:
Quick Fix:
Status: Assign to:
Category:
Summary:
From: csaba at alum dot mit dot edu
New email:
Version: OS:
New/Additional Comment:

[6 Mar 2003 12:06am UTC] csaba at alum dot mit dot edu
max(array("tdCommon", 0)) => "tdCommon"    // not a number

The documentation at php.net/max claims:
If one or more of the values is a float, all the values will be treated
as floats, and a float is returned. If none of the values is a float,
all of them will be treated as integers, and an integer is returned. 

Evidently, the behaviour of this function was intended to change
(extrapolating from http://bugs.php.net/bug.php?id=2676 (bug # 2676)).

This should be reflected in the documentation.  (I was trying to get the
key of the most recent element I had created in a "semi-associative"
array by $array[] = $newVal and max as advertised would have done the
trick.  Could it still work?  I don't know, because I don't really know
what it's supposed to be doing anymore.  For example, what type of sort
is being done now?).

Csaba Gabor
[18 Jul 2003 8:05pm UTC] philip@php.net
The min() and max() docs have been updated (rewritten) and will show up
after the next manual build.  Thanks for the report :)

http://cvs.php.net/cvs.php/phpdoc/en/reference/math/functions/max.xml
http://cvs.php.net/cvs.php/phpdoc/en/reference/math/functions/min.xml

RSS feed | show source 

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