Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82607 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1496 invoked from network); 13 Feb 2015 12:12:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Feb 2015 12:12:00 -0000 Authentication-Results: pb1.pair.com header.from=tpunt@hotmail.co.uk; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tpunt@hotmail.co.uk; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain hotmail.co.uk designates 157.55.1.169 as permitted sender) X-PHP-List-Original-Sender: tpunt@hotmail.co.uk X-Host-Fingerprint: 157.55.1.169 dub004-omc2s30.hotmail.com Received: from [157.55.1.169] ([157.55.1.169:63170] helo=DUB004-OMC2S30.hotmail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 14/97-62214-E0AEDD45 for ; Fri, 13 Feb 2015 07:11:58 -0500 Received: from DUB113-W40 ([157.55.1.137]) by DUB004-OMC2S30.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Fri, 13 Feb 2015 04:11:54 -0800 X-TMN: [m6iwRPGf6/Jm4n3BFGkXIXi4Dir7BctL] X-Originating-Email: [tpunt@hotmail.co.uk] Message-ID: Content-Type: multipart/alternative; boundary="_d6da0ed7-ecab-4f19-827c-89b57b833bc2_" To: reeze CC: "internals@lists.php.net" Date: Fri, 13 Feb 2015 12:11:54 +0000 Importance: Normal In-Reply-To: References: <54DDA797.4030501@php.net>, <1E15BAAB-C8FC-49A9-B73F-E0E7DEFA208D@ajf.me>, MIME-Version: 1.0 X-OriginalArrivalTime: 13 Feb 2015 12:11:54.0730 (UTC) FILETIME=[41B4C4A0:01D04786] Subject: RE: [PHP-DEV] [DISCUSSION] Make empty() a Variadic From: tpunt@hotmail.co.uk (Thomas Punt) --_d6da0ed7-ecab-4f19-827c-89b57b833bc2_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Reeze=2C > From: reeze@php.net >=20 > For example: echo $a=2C $b=2C $c=2C & empty($a=2C $b=2C $c)=2C they are t= reated equal=2C >=20 > if the empty() means if any one of them is empty then result is TRUE=2C t= he > advantage of it disappeared: >=20 > if (empty($a=2C $b=2C $c)) { > // you might want to check it again. > if (empty($a)) { > //blah blah. > } else if (empty($b)) { >=20 > } > } >=20 Having empty() return TRUE if *all* arguments are empty=2C and FALSE otherw= ise 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()=2C which could be s= omewhat confusing to users. >=20 > --=20 > Reeze Xia > http://reeze.cn Thanks=2C Tom = --_d6da0ed7-ecab-4f19-827c-89b57b833bc2_--