note 124114 rejected from function.count by cmb

From: Date: Thu, 15 Aug 2019 08:48:31 +0000
Subject: note 124114 rejected from function.count by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-211887@lists.php.net to get a copy of this message
Note Submitter: nstiac at gmail dot com ---- 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)

« previous php.notes (#211887) next »