[PHP-DOC] cvs: phpdoc /en/reference/math/functions max.xml min.xml
vrana Fri Aug 17 16:34:41 2007 UTC Modified files: /phpdoc/en/reference/math/functions max.xml min.xml Log: Convert non-numeric strings to 0 only if compared to integer (bug #38883) http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/math/functions/max.xml?r1=1.11r2=1.12diff_format=u Index: phpdoc/en/reference/math/functions/max.xml diff -u phpdoc/en/reference/math/functions/max.xml:1.11 phpdoc/en/reference/math/functions/max.xml:1.12 --- phpdoc/en/reference/math/functions/max.xml:1.11 Wed Jun 20 22:24:51 2007 +++ phpdoc/en/reference/math/functions/max.xml Fri Aug 17 16:34:40 2007 @@ -1,5 +1,5 @@ ?xml version=1.0 encoding=iso-8859-1? -!-- $Revision: 1.11 $ -- +!-- $Revision: 1.12 $ -- refentry xmlns=http://docbook.org/ns/docbook; xml:id=function.max refnamediv refnamemax/refname @@ -27,7 +27,7 @@ note para PHP will evaluate a non-numeric typestring/type as -literal0/literal, but still return the string if it's seen as the +literal0/literal if compared to typeinteger/type, but still return the string if it's seen as the numerically highest value. If multiple arguments evaluate to literal0/literal, functionmax/function will return a numeric literal0/literal if given, else the alphabetical highest string http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/math/functions/min.xml?r1=1.10r2=1.11diff_format=u Index: phpdoc/en/reference/math/functions/min.xml diff -u phpdoc/en/reference/math/functions/min.xml:1.10 phpdoc/en/reference/math/functions/min.xml:1.11 --- phpdoc/en/reference/math/functions/min.xml:1.10 Wed Jun 20 22:24:51 2007 +++ phpdoc/en/reference/math/functions/min.xml Fri Aug 17 16:34:41 2007 @@ -1,5 +1,5 @@ ?xml version=1.0 encoding=iso-8859-1? -!-- $Revision: 1.10 $ -- +!-- $Revision: 1.11 $ -- refentry xmlns=http://docbook.org/ns/docbook; xml:id=function.min refnamediv refnamemin/refname @@ -25,7 +25,7 @@ note para PHP will evaluate a non-numeric typestring/type as -literal0/literal, but still return the string if it's seen as the +literal0/literal if compared to typeinteger/type, but still return the string if it's seen as the numerically lowest value. If multiple arguments evaluate to literal0/literal, functionmin/function will return the lowest alphanumerical string value if any strings are given, else a numeric
[PHP-DOC] cvs: phpdoc /en/reference/math/functions max.xml min.xml
philip Fri Jul 18 21:03:46 2003 EDT Modified files: /phpdoc/en/reference/math/functions max.xml min.xml Log: A complete rewrite of min() and max() docs to reflect how they really work, including many examples. See also count(). This also closes bug #22565 Index: phpdoc/en/reference/math/functions/max.xml diff -u phpdoc/en/reference/math/functions/max.xml:1.4 phpdoc/en/reference/math/functions/max.xml:1.5 --- phpdoc/en/reference/math/functions/max.xml:1.4 Sat Jan 18 23:43:55 2003 +++ phpdoc/en/reference/math/functions/max.xml Fri Jul 18 21:03:46 2003 @@ -1,5 +1,5 @@ ?xml version=1.0 encoding=iso-8859-1? -!-- $Revision: 1.4 $ -- +!-- $Revision: 1.5 $ -- !-- splitted from ./en/functions/math.xml, last change in rev 1.2 -- refentry id=function.max refnamediv @@ -9,30 +9,64 @@ refsect1 titleDescription/title methodsynopsis - typenumber/typemethodnamemax/methodname - methodparamtypemixed/typeparameterarg1/parameter/methodparam - methodparamtypemixed/typeparameterarg2/parameter/methodparam - methodparamtypemixed/typeparameterargn/parameter/methodparam + typemixed/typemethodnamemax/methodname + methodparamtypenumber/typeparameterarg1/parameter/methodparam + methodparamtypenumber/typeparameterarg2/parameter/methodparam + methodparam choice=opttypenumber/typeparameter.../parameter/methodparam +/methodsynopsis +methodsynopsis + typemixed/typemethodnamemax/methodname + methodparamtypearray/typeparameternumbers/parameter/methodparam + methodparam choice=opttypearray/typeparameter.../parameter/methodparam /methodsynopsis para functionmax/function returns the numerically highest of the parameter values. /para para - If the first parameter is an array, functionmax/function + If the first and only parameter is an array, functionmax/function returns the highest value in that array. If the first parameter is an integer, string or float, you need at least two parameters and functionmax/function returns the biggest of these values. You can compare an unlimited number of values. /para +note + para + PHP will evaluate a non-numeric typestring/type as + literal0/literal, but still return the string if it's seen as the + numerically highest value. If multiple arguments evaluate to + literal0/literal, functionmax/function will use the first one + it sees (the leftmost value). + /para +/note para - 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. + example + titleExample uses of functionmax/function/title + programlisting role=php +![CDATA[ +?php +echo max(1, 3, 5, 6, 7); // 7 +echo max(array(2, 4, 5)); // 5 + +echo max(0, 'hello'); // 0 +echo max('hello', 0); // hello +echo max(-1, 'hello');// hello + +// With multiple arrays, max compares from left to right +// so in our example: 2 == 2, but 4 5 +$val = max(array(2, 4, 8), array(2, 5, 7)); // array(2, 5, 7) + +// If both an array and non-array are given, the array +// is always returned as it's seen as the largest +$val = max('string', array(2, 5, 7), 42); // array(2, 5, 7) +? +]] + /programlisting + /example /para para - See also functionmin/function. + See also functionmin/function and + functioncount/function. /para /refsect1 /refentry Index: phpdoc/en/reference/math/functions/min.xml diff -u phpdoc/en/reference/math/functions/min.xml:1.3 phpdoc/en/reference/math/functions/min.xml:1.4 --- phpdoc/en/reference/math/functions/min.xml:1.3 Sun Jun 2 00:36:16 2002 +++ phpdoc/en/reference/math/functions/min.xml Fri Jul 18 21:03:46 2003 @@ -1,5 +1,5 @@ ?xml version=1.0 encoding=iso-8859-1? -!-- $Revision: 1.3 $ -- +!-- $Revision: 1.4 $ -- !-- splitted from ./en/functions/math.xml, last change in rev 1.2 -- refentry id=function.min refnamediv @@ -9,65 +9,64 @@ refsect1 titleDescription/title methodsynopsis - typenumber/typemethodnamemin/methodname + typemixed/typemethodnamemin/methodname methodparamtypenumber/typeparameterarg1/parameter/methodparam methodparamtypenumber/typeparameterarg2/parameter/methodparam - methodparam choice=optparameter.../parameter/methodparam + methodparam choice=opttypenumber/typeparameter.../parameter/methodparam /methodsynopsis methodsynopsis - typenumber/typemethodnamemin/methodname + typemixed/typemethodnamemin/methodname methodparamtypearray/typeparameternumbers/parameter/methodparam + methodparam choice=opttypearray/typeparameter.../parameter/methodparam /methodsynopsis para functionmin/function returns the numerically lowest of the
[PHP-DOC] cvs: phpdoc /en/reference/math/functions max.xml
damsSat Jan 18 23:18:59 2003 EDT Modified files: /phpdoc/en/reference/math/functions max.xml Log: cross reference with min Index: phpdoc/en/reference/math/functions/max.xml diff -u phpdoc/en/reference/math/functions/max.xml:1.2 phpdoc/en/reference/math/functions/max.xml:1.3 --- phpdoc/en/reference/math/functions/max.xml:1.2 Wed Apr 17 02:39:54 2002 +++ phpdoc/en/reference/math/functions/max.xml Sat Jan 18 23:18:59 2003 @@ -1,5 +1,5 @@ ?xml version=1.0 encoding=iso-8859-1? -!-- $Revision: 1.2 $ -- +!-- $Revision: 1.3 $ -- !-- splitted from ./en/functions/math.xml, last change in rev 1.2 -- refentry id=function.max refnamediv @@ -8,12 +8,12 @@ /refnamediv refsect1 titleDescription/title - methodsynopsis - typemixed/typemethodnamemax/methodname - methodparamtypemixed/typeparameterarg1/parameter/methodparam - methodparamtypemixed/typeparameterarg2/parameter/methodparam - methodparamtypemixed/typeparameterargn/parameter/methodparam - /methodsynopsis +methodsynopsis + typenumber/typemethodnamemax/methodname + methodparamtypenumber/typeparameterarg1/parameter/methodparam + methodparamtypenumber/typeparameterarg2/parameter/methodparam + methodparamtypenumber/typeparameterargn/parameter/methodparam +/methodsynopsis para functionmax/function returns the numerically highest of the parameter values. @@ -30,6 +30,9 @@ 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. +/para +para + See also functionmax/function. /para /refsect1 /refentry -- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DOC] cvs: phpdoc /en/reference/math/functions max.xml
It works with arrays, keep it as mixed. Regards, Philip On Sun, 19 Jan 2003, Damien Seguy wrote: dams Sat Jan 18 23:18:59 2003 EDT Modified files: /phpdoc/en/reference/math/functions max.xml Log: cross reference with min Index: phpdoc/en/reference/math/functions/max.xml diff -u phpdoc/en/reference/math/functions/max.xml:1.2 phpdoc/en/reference/math/functions/max.xml:1.3 --- phpdoc/en/reference/math/functions/max.xml:1.2Wed Apr 17 02:39:54 2002 +++ phpdoc/en/reference/math/functions/max.xmlSat Jan 18 23:18:59 2003 @@ -1,5 +1,5 @@ ?xml version=1.0 encoding=iso-8859-1? -!-- $Revision: 1.2 $ -- +!-- $Revision: 1.3 $ -- !-- splitted from ./en/functions/math.xml, last change in rev 1.2 -- refentry id=function.max refnamediv @@ -8,12 +8,12 @@ /refnamediv refsect1 titleDescription/title - methodsynopsis - typemixed/typemethodnamemax/methodname - methodparamtypemixed/typeparameterarg1/parameter/methodparam - methodparamtypemixed/typeparameterarg2/parameter/methodparam - methodparamtypemixed/typeparameterargn/parameter/methodparam - /methodsynopsis +methodsynopsis + typenumber/typemethodnamemax/methodname + methodparamtypenumber/typeparameterarg1/parameter/methodparam + methodparamtypenumber/typeparameterarg2/parameter/methodparam + methodparamtypenumber/typeparameterargn/parameter/methodparam +/methodsynopsis para functionmax/function returns the numerically highest of the parameter values. @@ -30,6 +30,9 @@ 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. +/para +para + See also functionmax/function. /para /refsect1 /refentry -- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DOC] cvs: phpdoc /en/reference/math/functions max.xml
damsSat Jan 18 23:43:56 2003 EDT Modified files: /phpdoc/en/reference/math/functions max.xml Log: Reverting to mixed, and corecting see also Index: phpdoc/en/reference/math/functions/max.xml diff -u phpdoc/en/reference/math/functions/max.xml:1.3 phpdoc/en/reference/math/functions/max.xml:1.4 --- phpdoc/en/reference/math/functions/max.xml:1.3 Sat Jan 18 23:18:59 2003 +++ phpdoc/en/reference/math/functions/max.xml Sat Jan 18 23:43:55 2003 @@ -1,5 +1,5 @@ ?xml version=1.0 encoding=iso-8859-1? -!-- $Revision: 1.3 $ -- +!-- $Revision: 1.4 $ -- !-- splitted from ./en/functions/math.xml, last change in rev 1.2 -- refentry id=function.max refnamediv @@ -10,9 +10,9 @@ titleDescription/title methodsynopsis typenumber/typemethodnamemax/methodname - methodparamtypenumber/typeparameterarg1/parameter/methodparam - methodparamtypenumber/typeparameterarg2/parameter/methodparam - methodparamtypenumber/typeparameterargn/parameter/methodparam + methodparamtypemixed/typeparameterarg1/parameter/methodparam + methodparamtypemixed/typeparameterarg2/parameter/methodparam + methodparamtypemixed/typeparameterargn/parameter/methodparam /methodsynopsis para functionmax/function returns the numerically highest of the @@ -32,7 +32,7 @@ an integer is returned. /para para - See also functionmax/function. + See also functionmin/function. /para /refsect1 /refentry -- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php