Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22807 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16615 invoked by uid 1010); 17 Apr 2006 01:08:52 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 16600 invoked from network); 17 Apr 2006 01:08:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Apr 2006 01:08:52 -0000 X-Host-Fingerprint: 66.249.82.203 xproxy.gmail.com Linux 2.4/2.6 Received: from ([66.249.82.203:5990] helo=xproxy.gmail.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 50/98-19715-3AAE2444 for ; Sun, 16 Apr 2006 21:08:51 -0400 Received: by xproxy.gmail.com with SMTP id t14so342784wxc for ; Sun, 16 Apr 2006 18:08:49 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=g73hrt1nWJrQmGETzpV2954E9nppzp1W0QmFNASZifZllNIPR9OZr6Ee0LmQ51RPXL2RFwqJSgtVgD3PvYmOYcbSCaB/Tc3XPKEzyIjwJIce2YhIOViDVqWiTe50JCLT2ILIA/b9LDJYtnZjgjtH0M9fF4ly1+Xwqg+RtYG9WQI= Received: by 10.70.43.17 with SMTP id q17mr181389wxq; Sun, 16 Apr 2006 18:08:48 -0700 (PDT) Received: by 10.70.12.3 with HTTP; Sun, 16 Apr 2006 18:08:48 -0700 (PDT) Message-ID: <2e24b1e00604161808v26dd0c40t1f19b056ecabe37a@mail.gmail.com> Date: Sun, 16 Apr 2006 21:08:48 -0400 To: internals@lists.php.net In-Reply-To: <2e24b1e00604150752g69acab4er1058771d9e60a352@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_9580_20097437.1145236128502" References: <2e24b1e00604150752g69acab4er1058771d9e60a352@mail.gmail.com> Subject: Re: Inconsistency of empty() and isset() ? From: itrebal@gmail.com ------=_Part_9580_20097437.1145236128502 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline When I'm validating form data, there are many occasions (more than not) that I require most of them to be completed, and not left blank. In which case you would do: if(empty($_GET['var1'], $_GET['var2'], $_GET['var3'])){ //Display error, yadda yadda } as aposed to if(empty($_GET['var1']) || empty($_GET['var2']) || empty($_GET['var3'])){ //Display error, yadda yadda } which is a much cleaner and simpler method. Doing it the other way (AND/OR) doesn't seem to have many applications that I can see. On 4/15/06, itrebal@gmail.com wrote: > > The following is a direct excerpt from the PHP manual on empty, and isset= : > bool *empty* ( mixed var ) > bool *isset* ( mixed var [, mixed var [, ...]] ) > Is there a reason empty does not allow multiple variables at a time, as > isset? Was there thought behind it, or is it just an inconsistency? > -- ------------------------------------ Graham Christensen www.itrebal.com www.iamgraham.net ------=_Part_9580_20097437.1145236128502--