Hi Reeze,

> From: re...@php.net
> 
> For example: echo $a, $b, $c, & empty($a, $b, $c), they are treated equal,
> 
> if the empty() means if any one of them is empty then result is TRUE, the
> advantage of it disappeared:
> 
> if (empty($a, $b, $c)) {
> // you might want to check it again.
> if (empty($a)) {
> //blah blah.
> } else if (empty($b)) {
> 
> }
> }
> 


Having empty() return TRUE if *all* arguments are empty, and FALSE otherwise 
doesn't seem to be as useful (at least from what I've seen in code).


It's less common to see:

if (empty($a) && empty($b) && empty($c)) {}

than:

if (empty($a) || empty($b) || empty($c)) {}

Plus then the semantics wouldn't be inline with isset(), which could be 
somewhat confusing to users.

> 
> -- 
> Reeze Xia
> http://reeze.cn

Thanks,
Tom                                       

Reply via email to