Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88773 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4336 invoked from network); 13 Oct 2015 13:32:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Oct 2015 13:32:38 -0000 X-Host-Fingerprint: 178.62.40.5 ajf.me Received: from [178.62.40.5] ([178.62.40.5:27816] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AB/35-04042-5F70D165 for ; Tue, 13 Oct 2015 09:32:38 -0400 Message-ID: To: internals@lists.php.net References: <5C.21.16518.AA80C165@pb1.pair.com> X-Mozilla-News-Host: news://news.php.net Date: Tue, 13 Oct 2015 14:32:34 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:41.0) Gecko/20100101 Firefox/41.0 SeaMonkey/2.38 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 178.62.40.5 Subject: Re: [PHP-DEV] Scalar type hints and scalar type name aliases cause confuson From: ajf@ajf.me (Andrea Faulds) Hi Paul, Paul Dragoonis wrote: > On Mon, Oct 12, 2015 at 8:23 PM, Andrea Faulds wrote: > > Hi Andrea, > > Can you go ahead and make a branch/PR to add these type aliases in? There's > no right or wrong answer to 'int' versus 'integer', so allowing devs to > continue to use either will be welcoming. > I've written a pull request (doesn't have tests yet) that makes the other type names produce helpful error messages: https://github.com/php/php-src/pull/1572 e.g. $ ./sapi/cli/php -r 'function foo(): long {}' Fatal error: 'long' is not a valid type hint, use 'int' instead in Command line code on line 1 This would completely solve the confusion issue, I think. A crystal clear error message. As I've said in a different email, I don't like the idea of allowing the aliases because it'd be another set of coding style differences we don't need. This lets us pick one name and stick with it, without causing confusion. Thanks. -- Andrea Faulds http://ajf.me/