empty(array()) implicitly == false but reported to use instead of boolean
Opened this issue · 0 comments
ktomk commented
The suggestion to use empty() instead of implicit boolean false is superfluous, empty checks the same (plus isset() check) according to the manual (http://php.net/empty):
A variable is considered empty if it does not exist or if its value equals FALSE.
isset() check is not intended most often, so suggesting empty() is not only superfluous for existing variables as in this reported case but also misleading as it suggest the variable might not exist (for some reason) while it absolutely does under the reported circumstances.