Re: Change in type-hint representation
| From: | Andrea Faulds | Date: | Wed, 11 Jan 2017 22:30:18 +0000 |
| Subject: | Re: Change in type-hint representation | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-97707@lists.php.net to get a copy of this message | ||
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? MaybeC's enum members always have the typezend_type_codeif you like thecodename for it? Also we already use "kind" in the AST; should it beZEND_TYPE_KINDandzend_type_kindinstead?
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/