#34532 [NEW]: It would be nice if empty() could accept multiple arguments just like isset()

From: Date: Fri, 16 Sep 2005 18:35:54 +0000
Subject: #34532 [NEW]: It would be nice if empty() could accept multiple arguments just like isset()
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-85169@lists.php.net to get a copy of this message
From:             phpbugs at majiclab dot com
Operating system: N/A
PHP version:      5.0.5
PHP Bug Type:     Feature/Change Request
Bug description:  It would be nice if empty() could accept multiple arguments just like isset()

Description:
------------
It would be nice if empty() would accept multiple arguments 
like isset() does.  It would be functionally equivalent to:

empty(var) || empty(var2) ... || empty(varN)

Reproduce code:
---------------
<?php
$a = 1;
if (empty($a, $b, $c)) {
    echo 'Either $a, $b or $c was empty/did not exist.';
}
?>

Expected result:
----------------
Either $a, $b or $c was empty/did not exist.

Actual result:
--------------
parse error, unexpected ',', expecting ')' in /.../file.php on 
line 3

-- 
Edit bug report at http://bugs.php.net/?id=34532&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=34532&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34532&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34532&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=34532&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=34532&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=34532&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=34532&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=34532&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=34532&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=34532&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=34532&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=34532&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=34532&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=34532&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=34532&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=34532&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=34532&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=34532&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=34532&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=34532&r=mysqlcfg


Thread (2 messages)

« previous php.bugs (#85169) next »