|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1999-08-31 11:27 UTC] ssb at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 08:00:01 2025 UTC |
Simple script to reproduce: --------------------------- <?php print max(20.0,10.0,30.0); ?> prints 20 instead of 30. (In fact, it always prints the first value) Here is a patch which worked for me, but I'm not sure whether it's the correct way of fixing it: *** basic_functions.c Mon Aug 30 15:05:51 1999 --- basic_functions.c.org Sun Aug 29 13:05:46 1999 *************** *** 1388,1395 **** min = args[0]; for (i=1; i<ARG_COUNT(ht); i++) { ! compare_function(&result, min, args[i]); ! if (result.value.lval > 0) { min = args[i]; } } --- 1388,1395 ---- min = args[0]; for (i=1; i<ARG_COUNT(ht); i++) { ! is_smaller_function(&result, args[i], min); ! if (result.value.lval == 1) { min = args[i]; } } *************** *** 1439,1446 **** max = args[0]; for (i=1; i<ARG_COUNT(ht); i++) { ! compare_function(&result, max, args[i]); ! if (result.value.lval < 0) { max = args[i]; } } --- 1439,1446 ---- max = args[0]; for (i=1; i<ARG_COUNT(ht); i++) { ! is_smaller_or_equal_function(&result, args[i], max); ! if (result.value.lval == 0) { max = args[i]; } }