note 27693 deleted from function.max by didou

From: Date: Wed, 23 Jul 2003 01:25:44 +0000
Subject: note 27693 deleted from function.max by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-52476@lists.php.net to get a copy of this message
Note Submitter: simon@esoft.dk ---- Apparently max() thinks false is greater than 0... example: if(max(false,0)==false) echo "blah"; this proves a problem when comparing with values from a database if these values doesn't exist and you need 0 instead of false. a workaround is to cast the values to int's, so max((int)false,0) returns 0 as it should

« previous php.notes (#52476) next »