Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71640 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1555 invoked from network); 27 Jan 2014 15:57:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jan 2014 15:57:05 -0000 Authentication-Results: pb1.pair.com smtp.mail=happy.melon.wiki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=happy.melon.wiki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.181 as permitted sender) X-PHP-List-Original-Sender: happy.melon.wiki@gmail.com X-Host-Fingerprint: 209.85.216.181 mail-qc0-f181.google.com Received: from [209.85.216.181] ([209.85.216.181:51290] helo=mail-qc0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 34/00-01140-0D186E25 for ; Mon, 27 Jan 2014 10:57:05 -0500 Received: by mail-qc0-f181.google.com with SMTP id e9so8137215qcy.26 for ; Mon, 27 Jan 2014 07:57:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=gi7xMBIt/iwkLXp9jmofAibM8kGL/jfc+zDwp58lF+U=; b=Xz+XwVUoPl9it8Dn/UfZLOKUIohZqzLQiZSG+ctKdG9+6cVhy/0QWaDvidWZVQEr2j 75e5qa7cD5Ycz3yD7iJbBsuzcPxmPUqP0Ctb6hRFFm7NKHlg+Y8SHjZQUdbexBsLlLJr I6vxxQ9CBiN+ZGVzh0TuN0/aFgXdsS8bLm5bM3u6rQeLglKttpb1tqjjLeJeUwO4+gq2 A5uYk+e3VkHjdNb7v6aWgtbm2v4GVaMzCqn5b06usSwrhJ4K9c44ZwelaLyGh4mt2GDU qXhSyvjLaiL+KeFeaJJqW9YoKhfVO1oN25bgpoKl6E2AlzDNPHMyLb5rShx+1xaVrnTj ixcA== MIME-Version: 1.0 X-Received: by 10.224.65.135 with SMTP id j7mr44397525qai.10.1390838221734; Mon, 27 Jan 2014 07:57:01 -0800 (PST) Sender: happy.melon.wiki@gmail.com Received: by 10.140.86.72 with HTTP; Mon, 27 Jan 2014 07:57:01 -0800 (PST) In-Reply-To: <20140127110519.GM14262@phcomp.co.uk> References: <52E55D0F.3030308@ajf.me> <52E59BE8.7070202@sugarcrm.com> <20140127110519.GM14262@phcomp.co.uk> Date: Mon, 27 Jan 2014 15:57:01 +0000 X-Google-Sender-Auth: Wg25aR-Ya6BLXdn1yTJcKRh_IC8 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary=001a11c2e90425956a04f0f5c291 Subject: Re: [PHP-DEV] PHP and case-sensitivity inconsistency in PHP 6 From: happy.melon.wiki+gb@gmail.com (George Bond) --001a11c2e90425956a04f0f5c291 Content-Type: text/plain; charset=ISO-8859-1 On 27 January 2014 11:05, Alain Williams wrote: > On Sun, Jan 26, 2014 at 03:36:08PM -0800, Stas Malyshev wrote: > * there are a few special values that are currently case insenitive, eg: > NULL, TRUE. > I would suggest that they only be recognised in upper case, eg: null > would be > invalid. This fits with the meme of constant names being in upper case. > Why would you want FUNCTION tellMeEverythingIsOk(){ ECHO TRUE; } to work but not function tellMeEverythingIsOk(){ echo true; } ?? true/false/null aren't constants, they're language constructs like 'array' and 'callable' (and arguably 'function') - or at least they're part of the same group (base types) and would expect them to have the same case conventions. I wouldn't think anyone would want to enforce $var = ARRAY( 'foo' ); on the PHP world. If we're enforcing case sensitivity with the true/false/null keywords, I'd expect 'true' to be the primitive type, 'TRUE' to be a constant that someone could define for some dubiously-sensible purpose (like having the value needed to be set in some database), and 'True' to be a class that someone could define for a slightly more sophisticated purpose ($t = new True(); try { $db->set( 'field', $t->getForDatabase() ); } catch { echo "Could not set field to {$t->getHumanReadable()} ). But I don't see any reason to make true/false/null case sensitive (whichever canonical casing you then choose) in the first place. G --001a11c2e90425956a04f0f5c291--