Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59687 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7976 invoked from network); 10 Apr 2012 23:51:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Apr 2012 23:51:11 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.183 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.183 smtp183.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.183] ([67.192.241.183:46849] helo=smtp183.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C2/B4-18401-D67C48F4 for ; Tue, 10 Apr 2012 19:51:10 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp18.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 7F542268308; Tue, 10 Apr 2012 19:51:07 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp18.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 3E5302682F8; Tue, 10 Apr 2012 19:51:07 -0400 (EDT) Message-ID: <4F84C76A.9090104@sugarcrm.com> Date: Tue, 10 Apr 2012 16:51:06 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0) Gecko/20120313 Thunderbird/11.0 MIME-Version: 1.0 To: Nikita Popov CC: PHP internals References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Allow non-variable arguments to empty() From: smalyshev@sugarcrm.com (Stas Malyshev) 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