Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60398 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93053 invoked from network); 1 May 2012 16:43:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 May 2012 16:43:51 -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.220.170 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.220.170 mail-vx0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:51132] helo=mail-vx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 00/B8-38165-5C210AF4 for ; Tue, 01 May 2012 12:43:50 -0400 Received: by vcbfo14 with SMTP id fo14so3268639vcb.29 for ; Tue, 01 May 2012 09:43:47 -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=u9b+ZZSDQhoiROcvEnCb84i465N2y9aX2t/7fIKC1EQ=; b=U5/Uo+SG2N+sch35koIt8QNg6CIL5jCimjZl4KO3ad7VPJN09+a9p9HIwZDJe74VUr h0jOXYMw6NRrjEZCmtYm6/32hrgcIjykwaZ/W9CXNmmfjaSg7lqn/kquiT6wYTmXYBRF 9UkNneMSYGHnA5DUjDhiwOGFjmWW+8412Y/jp+N/nilLaNgqWXTPT7pjgOTqy/eXIcSE thkEnwWziOnUAi/Sc4IHUbaurIjkFdjGy67uS9Dy1JFQnpvwEQXADR8TOO4NUxleUfLV zWqAoQNtORqjKRnib7Wsz0m0Kbk9jCWbm2YFhMKP3lSJvNU7JWyKLW2sRbb1AEjafrCA Qt/A== MIME-Version: 1.0 Received: by 10.220.228.193 with SMTP id jf1mr459629vcb.52.1335890626926; Tue, 01 May 2012 09:43:46 -0700 (PDT) Received: by 10.220.58.72 with HTTP; Tue, 1 May 2012 09:43:46 -0700 (PDT) In-Reply-To: References: Date: Tue, 1 May 2012 18:43:46 +0200 Message-ID: To: Nikita Popov Cc: Patrick ALLAERT , PHP internals Content-Type: multipart/alternative; boundary=14dae9cdc12f46d7ff04befc46c7 Subject: Re: [PHP-DEV] [RFC] Allow non-variable arguments to empty() and isset() From: tyra3l@gmail.com (Ferenc Kovacs) --14dae9cdc12f46d7ff04befc46c7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, Apr 30, 2012 at 2:39 PM, Nikita Popov wr= ote: > On Mon, Apr 30, 2012 at 9:50 AM, Patrick ALLAERT > wrote: > > Hi, > > > > 2012/4/12 Nikita Popov : > >> PS: I added isset() too, to address the consistency concerns mentioned > on IRC. > > > > I would have voted +1 if it didn't contain the isset() change. None of > > the examples used in the isset_with_expr.phpt test seems logic to me. > > > > Care to explain the consistency concerns here? > The concerns came from laruence, so maybe he could drop a comment here > :) Basically, empty() and isset() are very similar in their nature, so > changing only one of them might seem inconsistent. > > Personally I don't see much use in allowing expressions in isset(). > People being confused by empty(trim($_GET['foo'])) not working is > quite common, but I've never heard of somebody trying to use isset() > on a function call. The name already makes clear that it's intended > for use on variables. albeit I'm not laruence, but I also supported the idea to keep consistency across the allowed params of empty and isset. here is my reasoning: - both isset and empty are language constructs, which many people use almost interchangeability, changing one of them in a way that the same expression works with one of them, but blows up with a parse error seems wrong to me. - maybe you think that isset doesn't really make sense with expressions, but don't forget that this patch would also allow constants to be used with empty/isset, and imo isset(some_constant); would be useful and maybe more straightforward for the people new to the language. --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --14dae9cdc12f46d7ff04befc46c7--