Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59808 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9833 invoked from network); 12 Apr 2012 23:05:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Apr 2012 23:05:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.211.66 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.211.66 config.schlueters.de Received: from [217.114.211.66] ([217.114.211.66:38426] helo=config.schlueters.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 43/C6-00290-0CF578F4 for ; Thu, 12 Apr 2012 19:05:38 -0400 Received: from [192.168.2.230] (ppp-93-104-21-136.dynamic.mnet-online.de [93.104.21.136]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by config.schlueters.de (Postfix) with ESMTPSA id 85892607BF; Fri, 13 Apr 2012 01:05:33 +0200 (CEST) To: Nikita Popov Cc: PHP internals In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Date: Fri, 13 Apr 2012 01:05:31 +0200 Message-ID: <1334271932.4609.161.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Allow non-variable arguments to empty() From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Wed, 2012-04-11 at 00:53 +0200, Nikita Popov wrote: > > Currently the empty() language construct only works on variables. You > can write if (empty($array)) but not empty if (empty(getSomeArray()). I've mentioned this thought off-list already but let's discuss it officially: A fear I have is that this makes empty more looking like a function, while not being one. Right now one notices quite quickly that it is something else. Things like $check = $condition ? "empty" : "isset"; $check($bar); trigger an even more confusing error (Call to undefined function) I'm not sure whether that's a strong argument, but I guess it's good enough to be noted :-) johannes