note 129211 added to function.str-starts-with
| From: | Anonymous at main dot php dot net | Date: | Wed, 31 Jan 2024 14:43:59 +0000 |
| Subject: | note 129211 added to function.str-starts-with | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221165@lists.php.net to get a copy of this message | ||
Just a little warn:
php > var_dump(str_starts_with('foobar', null));
bool(true)
Because null converted to empty string and as above written: "All strings start with the empty
string"
Be careful, you do not want this type of bug in your app. :)
----
Server IP: 45.112.84.4
Probable Submitter: 45.91.157.134 (proxied: 2a0d:3344:1b1d:8d10::25a)
----
Manual Page -- https://php.net/manual/en/function.str-starts-with.php
Edit -- https://main.php.net/note/edit/129211
Del: integrated -- https://main.php.net/note/delete/129211/integrated
Del: useless -- https://main.php.net/note/delete/129211/useless
Del: bad code -- https://main.php.net/note/delete/129211/bad+code
Del: spam -- https://main.php.net/note/delete/129211/spam
Del: non-english -- https://main.php.net/note/delete/129211/non-english
Del: in docs -- https://main.php.net/note/delete/129211/in+docs
Del: other reasons-- https://main.php.net/note/delete/129211
Reject -- https://main.php.net/note/reject/129211
Search -- https://main.php.net/manage/user-notes.php