note 116818 added to function.stripos
| From: | spam at kleppinger dot com | Date: | Wed, 04 Mar 2015 14:08:13 +0000 |
| Subject: | note 116818 added to function.stripos | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-201857@lists.php.net to get a copy of this message | ||
Regarding the function by spam at wikicms dot org
It is very bad practice to use the same function name as an existing php function but have a
different output format. Someone maintaining the code in the future is likely to be very confused
by this. It will also be hard to eradicate from a codebase because the naming is identical so each
use of stripos() would have to be analyzed to see how it is expecting the output format (bool or
number/bool).
Calling it string_found() or something like that would make a lot more sense for long-term use.
----
Server IP: 72.52.91.14
Probable Submitter: 70.116.53.57
----
Manual Page -- http://php.net/manual/en/function.stripos.php
Edit -- https://master.php.net/note/edit/116818
Del: integrated -- https://master.php.net/note/delete/116818/integrated
Del: useless -- https://master.php.net/note/delete/116818/useless
Del: bad code -- https://master.php.net/note/delete/116818/bad+code
Del: spam -- https://master.php.net/note/delete/116818/spam
Del: non-english -- https://master.php.net/note/delete/116818/non-english
Del: in docs -- https://master.php.net/note/delete/116818/in+docs
Del: other reasons-- https://master.php.net/note/delete/116818
Reject -- https://master.php.net/note/reject/116818
Search -- https://master.php.net/manage/user-notes.php