Re: Change in type-hint representation

From: 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? 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/

« previous php.internals (#97707) next »