note 60373 added to function.substr
| From: | eallik at hotmail dot com | Date: | Thu, 05 Jan 2006 03:22:35 +0000 |
| Subject: | note 60373 added to function.substr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-101237@lists.php.net to get a copy of this message | ||
Be careful when comparing the return value of substr to FALSE. FALSE may be returned even if the
output is a valid string.
substr("0", 0); // equals "0", comparision with FALSE evaluates to true, because
"0" == 0 == FALSE
----
Manual Page -- http://www.php.net/manual/en/function.substr.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+60373
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60373&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60373&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60373&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60373&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60373&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60373&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60373&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+60373&report=yes
Search -- http://master.php.net/manage/user-notes.php