|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-09-19 15:34 UTC] ryanhollett at hotmail dot com
[2007-08-17 16:34 UTC] vrana@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 19:00:01 2025 UTC |
Description: ------------ From the php documentation for the min function "PHP will evaluate a non-numeric string as 0, but still return the string if it's seen as the numerically lowest value." It seems that this is incorrect. When a non-numeric string and a numeric string are passed in, the numeric string seems to be returned as the the min value. Reproduce code: --------------- <?php echo min("a", "2"); echo "\n"; echo min("2", "a"); echo "\n"; echo min("a", "-2"); echo "\n"; echo min("-2", "a"); ?> Expected result: ---------------- a a -2 -2 Actual result: -------------- 2 2 -2 -2