note 15072 deleted from function.max by bjori
| From: | bjori@php.net | Date: | Mon, 27 Mar 2006 11:40:04 +0000 |
| Subject: | note 15072 deleted from function.max by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-106751@lists.php.net to get a copy of this message | ||
Note Submitter: jesusjr at mindless dot com
----
Be careful:
<?
$a = array(1,2,3,4,"5","N/A");
$b = array(1,2,3,4,'5','N/A');
echo "A: ".max($a)." : ";
echo "B: ".max($b)." : ";
echo (max($a)>0)?max($a):'max: 0';
?>
This will return:
A: N/A : B: N/A : Max: 0
I guess N/A (0/0) is equal to infinity (or >5), until it is compared to zero?