note 124114 added to function.count
| From: | nstiac at gmail dot com | Date: | Thu, 15 Aug 2019 04:26:29 +0000 |
| Subject: | note 124114 added to function.count | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-211886@lists.php.net to get a copy of this message | ||
Why o why would you decide to throw a warning on count !!
You are turning PHP into Java where EVERY SINGLE variable has to be initialized first in order to be
used!!!
Counting a non existant variable is a way to check for its existence :
if(count(var)>0)do x [where var may exist or not]
Why would one need to create redundant code to achieve the same:
if(isset(var)){ if(count(var)){ do x !!!! this requires a double check...
It makes count(undefined_sense)
----
Server IP: 208.43.231.9
Probable Submitter: 82.199.157.54 (proxied: 187.189.50.251)
----
Manual Page -- http://php.net/manual/en/function.count.php
Edit -- https://master.php.net/note/edit/124114
Del: integrated -- https://master.php.net/note/delete/124114/integrated
Del: useless -- https://master.php.net/note/delete/124114/useless
Del: bad code -- https://master.php.net/note/delete/124114/bad+code
Del: spam -- https://master.php.net/note/delete/124114/spam
Del: non-english -- https://master.php.net/note/delete/124114/non-english
Del: in docs -- https://master.php.net/note/delete/124114/in+docs
Del: other reasons-- https://master.php.net/note/delete/124114
Reject -- https://master.php.net/note/reject/124114
Search -- https://master.php.net/manage/user-notes.php