Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97707 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36094 invoked from network); 11 Jan 2017 22:30:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jan 2017 22:30:38 -0000 X-Host-Fingerprint: 95.144.152.155 unknown Received: from [95.144.152.155] ([95.144.152.155:4774] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1C/D0-30525-402B6785 for ; Wed, 11 Jan 2017 17:30:33 -0500 Message-ID: <1C.D0.30525.402B6785@pb1.pair.com> To: internals@lists.php.net References: Date: Wed, 11 Jan 2017 22:30:18 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 95.144.152.155 Subject: Re: [PHP-DEV] Change in type-hint representation From: ajf@ajf.me (Andrea Faulds) Hi Levi, Levi Morrison wrote: > As part of this effort can we refactor the IS_LONG, IS_ARRAY, > IS_OBJECT, etc macros to use an enum? Maybe `zend_type_code` if you > like the `code` name for it? Also we already use "kind" in the AST; > should it be `ZEND_TYPE_KIND` and `zend_type_kind` instead? C's enum members always have the type `int`. However, typically PHP uses the smaller `zend_uchar` for representing a type code. I guess this is why we don't use an enum already. Having a typedef of zend_uchar for this purpose would be great, though. It would make some function signatures more obvious (e.g. is_numeric_string and friends return a zend_uchar for the type of the result, and it'd be clearer this is the case). Thanks. -- Andrea Faulds https://ajf.me/