Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60421 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92204 invoked from network); 2 May 2012 11:38:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 May 2012 11:38:46 -0000 Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.42 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.160.42 mail-pb0-f42.google.com Received: from [209.85.160.42] ([209.85.160.42:62423] helo=mail-pb0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 36/19-38165-5CC11AF4 for ; Wed, 02 May 2012 07:38:46 -0400 Received: by pbbrp12 with SMTP id rp12so1020582pbb.29 for ; Wed, 02 May 2012 04:38:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Dvs2BDXxO1uU0p54umc8JdJZs/T8IUM5Uhc+WvfM7vg=; b=P6FyqPnxj8BCG2Iv2uWOaLZCZ2GDg/BdoJVkuONjLQboU71CNaK676VCS446lhNxCM sSUVIvjd9hHxCNVA9tvXSKdxpaS/hMb6txicmgpGFpoe5djpi8XLYJKSf9b1M6NiacGo YmS0EUT14znzUEOQ5KIUem8j1yMLEOp+eouM4JOr+6wMN/vf2bWfIEixO1Cx8XiSHjve fWm87B3ulA2LdtkDRHYZKvmeSEcF9Z3KWLCaGCMSFa7z54M3nVnTFyEaaSsRFoUJpuTD 8OGnYcWCFeQ++mlyIvOYhs23OiHzd9RVMy+NRaLg/yv+js3ErPPKnsmNRuZafUkIWRES 2fhw== MIME-Version: 1.0 Received: by 10.68.221.227 with SMTP id qh3mr8239659pbc.43.1335958723403; Wed, 02 May 2012 04:38:43 -0700 (PDT) Received: by 10.68.229.197 with HTTP; Wed, 2 May 2012 04:38:43 -0700 (PDT) In-Reply-To: References: Date: Wed, 2 May 2012 13:38:43 +0200 Message-ID: To: Pierre Joye Cc: Laruence , Patrick ALLAERT , Nikita Popov , PHP internals Content-Type: multipart/alternative; boundary=e89a8ff255ae249e3604bf0c2104 Subject: Re: [PHP-DEV] [RFC] Allow non-variable arguments to empty() and isset() From: tyra3l@gmail.com (Ferenc Kovacs) --e89a8ff255ae249e3604bf0c2104 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, May 2, 2012 at 11:43 AM, Pierre Joye wrote: > hi, > > On Wed, May 2, 2012 at 11:36 AM, Ferenc Kovacs wrote: > > > $foo=3Dnull; > > var_dump(isset($foo)); //prints bool(false) > > No offset meant, but it is totally expected and well known, and as far > as I remember documented too. Assigning NULL to a variable unsets it > (so to say). > > sure, as I quoted the documentation here. I just wanted to emphasize, that isset not only checks if a variable is set or not, but also checks the value of the variable, which makes your argument ("An expression is not set per se. isset goals, by design, from the very1st day, is to test the existence of a variable and a variable only.") much weaker. > >> empty() on the other hand, tests if something is empty, and only if it > >> is empty. The result of an expression can be empty. > >> > > > > an expression can also have a value of null. > > And NULL is empty. No issue here. > yeah, but that wasn't my point, I was saying that an expression can also have a value of null, which can be checked by isset, so empty and isset isn't any different in that regard for expressions. --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --e89a8ff255ae249e3604bf0c2104--