Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59690 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12387 invoked from network); 11 Apr 2012 00:08:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Apr 2012 00:08:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=kris.craig@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kris.craig@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.170 as permitted sender) X-PHP-List-Original-Sender: kris.craig@gmail.com X-Host-Fingerprint: 209.85.212.170 mail-wi0-f170.google.com Received: from [209.85.212.170] ([209.85.212.170:43532] helo=mail-wi0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9B/95-18401-C8BC48F4 for ; Tue, 10 Apr 2012 20:08:45 -0400 Received: by wibhr17 with SMTP id hr17so3532303wib.5 for ; Tue, 10 Apr 2012 17:08:42 -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=E5weveU4BneWc2BSsEjgqEqmEguSKJmZnOdXntbKzXs=; b=cwguFzwLQx7Fla6BJzk58H6MsgwgjE8GSt4taiZUUcRLVSciFEbll1qtyPRuKPtXYs GpNlk1JAFKsrjBGAJY4PcNV5Dk79DG1s6pyORfsSZDE/seqSlOyQqYyVh6BuGyOplxz+ dn094K3hWeSvedpbJtXrqyMhoCUrPRbNJaORFUlWhUrIQLobAbpeWkLRtBb5nmZVLchK MdSnOXxKLDH158p53pkOPoOAlr0oa4iQEkh72f1XnhtBAxAnx7IU4UNlA3ZXEIxY9KzY CkyZW88rpiQN6zKXJBgiaP31ADB+dF8oKjlSblj/gCjS9LvF+nWkptVKaMv11VLFysYs 9DRA== MIME-Version: 1.0 Received: by 10.180.91.168 with SMTP id cf8mr11252562wib.0.1334102922089; Tue, 10 Apr 2012 17:08:42 -0700 (PDT) Received: by 10.223.79.67 with HTTP; Tue, 10 Apr 2012 17:08:42 -0700 (PDT) In-Reply-To: <4F84C76A.9090104@sugarcrm.com> References: <4F84C76A.9090104@sugarcrm.com> Date: Tue, 10 Apr 2012 17:08:42 -0700 Message-ID: To: Stas Malyshev Cc: Nikita Popov , PHP internals Content-Type: multipart/alternative; boundary=f46d04389347c3d30c04bd5c0a00 Subject: Re: [PHP-DEV] Allow non-variable arguments to empty() From: kris.craig@gmail.com (Kris Craig) --f46d04389347c3d30c04bd5c0a00 Content-Type: text/plain; charset=ISO-8859-1 On Tue, Apr 10, 2012 at 4:51 PM, Stas Malyshev wrote: > Hi! > > > Currently the empty() language construct only works on variables. You > > can write if (empty($array)) but not empty if (empty(getSomeArray()). > > > > The original reason for this restriction probably is that - in a way - > > it "doesn't make sense" to pass anything but a variable to empty() as > > you could just use the ! operator in this case. if > > (empty(getSomeArray())) is logically equivalent to if > > (!getSomeArray()). > > Don't see any problem with that, looks good. Please add some tests > (including function calls and some expressions) and make a pull request. > -- > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > (408)454-6900 ext. 227 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > Err isn't this something that should go through the RFC process first? I think it's a good idea and I'll probably vote for it, but as I understand the RFC process was created specifically for stuff like this. --Kris --f46d04389347c3d30c04bd5c0a00--