note 2825 deleted from min by jeroen

From: Date: Wed, 15 Aug 2001 22:13:45 +0000
Subject: note 2825 deleted from min by jeroen
Groups: php.notes 
Request: Send a blank email to php-notes+get-16778@lists.php.net to get a copy of this message
I have had cases where min() doesn't work at all. I encourage you to make one by hand just to be sure. Here is a sample of the problem: <pre> $last = $rowcount-1; echo "$last, $offset, ".min($last,$offset); </pre> if $rowcount=4 and $offset=0 the min() returns 4! Don't know why. Don't care. Here is a simple replacement: <pre> Function myMin( $a, $b ) { if( $a < $b ) return $a; return $b; } </pre>

« previous php.notes (#16778) next »