Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60376 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81126 invoked from network); 30 Apr 2012 12:39:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Apr 2012 12:39:37 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@googlemail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.215.42 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@googlemail.com X-Host-Fingerprint: 209.85.215.42 mail-lpp01m010-f42.google.com Received: from [209.85.215.42] ([209.85.215.42:42282] helo=mail-lpp01m010-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6C/2B-13197-7088E9F4 for ; Mon, 30 Apr 2012 08:39:36 -0400 Received: by lahl5 with SMTP id l5so1864685lah.29 for ; Mon, 30 Apr 2012 05:39:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=B7/khbo10FYL3lFr32lLloo2romy2I1sQ5Z3mY6yIB0=; b=KhPaYI0R17XrVFYvECVY8HmF4/ojI4B6pNt7ugMerjUAdLG2ag0vlHnxhq4NEut8Wm DoPpdAyvIfKX7BtFfc9p+9qhYxm6HrY9bDVAyWlG+dc+MjI1D7vnnc2I7kZsmH6s/3rs rVT9nTbRFH+qHHgWwolFclLmkZ77kq/O/H2DbelNEWQVvBqbDxJh/Dx89d8oTIkDucox PrdKRf+/ZpgU1Z5KPrrlMgpuBQ4ZMymvSohXW+oDPtVgANO+44o//1ac1mCR6gDMzrr6 Rvw3GNB2M/HRQe0yb+4G3fr9TPYi+Kff4/nQSquxHfXeULSTz2vbDcNAVfHMiilyFqDz o4nw== MIME-Version: 1.0 Received: by 10.152.112.161 with SMTP id ir1mr19826043lab.13.1335789572642; Mon, 30 Apr 2012 05:39:32 -0700 (PDT) Received: by 10.152.1.196 with HTTP; Mon, 30 Apr 2012 05:39:32 -0700 (PDT) In-Reply-To: References: Date: Mon, 30 Apr 2012 14:39:32 +0200 Message-ID: To: Patrick ALLAERT Cc: PHP internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] [RFC] Allow non-variable arguments to empty() and isset() From: nikita.ppv@googlemail.com (Nikita Popov) 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. So, I'm not quite sure what I'm supposed to do about this. Should I add two vote options, one for empty() only, one for both? Nikita