Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88456 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38937 invoked from network); 23 Sep 2015 21:02:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Sep 2015 21:02:40 -0000 Authentication-Results: pb1.pair.com smtp.mail=mail@dasprids.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=mail@dasprids.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain dasprids.de from 46.4.80.198 cause and error) X-PHP-List-Original-Sender: mail@dasprids.de X-Host-Fingerprint: 46.4.80.198 server1.dasprids.de Received: from [46.4.80.198] ([46.4.80.198:60075] helo=mail.dasprids.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DC/D0-33598-F6313065 for ; Wed, 23 Sep 2015 17:02:39 -0400 Received: from [192.168.0.86] (unknown [5.158.132.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mail@dasprids.de) by mail.dasprids.de (Postfix) with ESMTPSA id D6ED1344044A; Wed, 23 Sep 2015 23:02:35 +0200 (CEST) To: Dominic Grostate , internals@lists.php.net References: Message-ID: <56031378.7060301@dasprids.de> Date: Wed, 23 Sep 2015 23:02:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: Implementing Generics, and none scalar default properties. From: mail@dasprids.de (Ben Scholzen 'DASPRiD') On 23.09.2015 22:35, Dominic Grostate wrote: > So far so good, but function calls are more complicated. I'm getting error: shift/reduce conflicts > > My guess is this due to the following scenario: > > > define('const_a', 1); > define('const_b', 2); > > $result = const_a < const_b > (10); > > While the intention might be to call a "function" const_a with the generic type const_b and 10 as an argument, it is also identical to a comparison expression. > > The example above throws: Parse error: syntax error, unexpected '>' since the expression is erroneous , so should that allowa generic type to be included to the syntax? Hm, this is indeed an "interesting" issue I didn't think about when writing up the RFC. Sadly, I have no idea about how to solve this issue. If you have no idea either on how to solve this, I'd suggest to skip generic methods for now and concentrate on generic classes only. -- Ben Scholzen 'DASPRiD' Community Review Team Member | mail@dasprids.de Zend Framework | http://www.dasprids.de