#22565 [Opn->Csd]: max not returning a number

From: Date: Sat, 19 Jul 2003 01:05:54 +0000
Subject: #22565 [Opn->Csd]: max not returning a number
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969355366@lists.php.net to get a copy of this message
ID: 22565 Updated by: philip@php.net Reported By: csaba at alum dot mit dot edu -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: All PHP Version: 4.3.0 New Comment: 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 Previous Comments: ------------------------------------------------------------------------ [2003-03-06 00:06:57] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=22565&edit=1

« previous php.doc (#969355366) next »