note 35604 added to function.max
| From: | romik at aha dot ru | Date: | Mon, 08 Sep 2003 07:54:33 +0000 |
| Subject: | note 35604 added to function.max | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-55778@lists.php.net to get a copy of this message | ||
I am very sorry, but there is mistake in my previous comment.
There must be three equal signs in the code
if ($var===strval(intval($var))) $var=intval($var);
With 2 equal signs it will convert empty string "" to zero 0
I beg my pardon for this.
Also, I have to say that is not behavior of only max() function, it is common for PHP then it
comparing variables of different types.
----
Manual Page -- http://www.php.net/manual/en/function.max.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35604
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35604&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35604&report=yes