Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59685 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4619 invoked from network); 10 Apr 2012 23:31:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Apr 2012 23:31:47 -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:59018] helo=config.schlueters.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DB/04-18401-1E2C48F4 for ; Tue, 10 Apr 2012 19:31:46 -0400 Received: from [192.168.2.230] (unknown [93.104.14.82]) (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 591D360056; Wed, 11 Apr 2012 01:31:42 +0200 (CEST) To: Jelle Zijlstra Cc: PHP internals In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Date: Wed, 11 Apr 2012 01:31:40 +0200 Message-ID: <1334100700.4609.79.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 Tue, 2012-04-10 at 19:12 -0400, Jelle Zijlstra wrote: > I think this is a useful simplification of the language, removing an > unnecessary exception. Would it also make sense to make empty() into a > library function instead of a language construct? That would not > result in > any BC break as far as I can see, but would allow some things that are > currently impossible (e.g., a method called "empty") and further > simplify > the language. It would, as an empty function would spit notices if the variable doesn't exist (or would have to use references, which would create the variable if it didn't exist already) and therefore destroy the primary use of that construct ... oh and such an empty won't be different from a simple "if" or bool cast. johannes