mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Zend/zend_type_code.h: convert to enum
This commit is contained in:
parent
0270a1e54c
commit
b98f18e7c3
1 changed files with 31 additions and 29 deletions
|
@ -17,38 +17,40 @@
|
|||
#ifndef ZEND_TYPE_CODE_H
|
||||
#define ZEND_TYPE_CODE_H
|
||||
|
||||
/* Regular data types: Must be in sync with zend_variables.c. */
|
||||
#define IS_UNDEF 0
|
||||
#define IS_NULL 1
|
||||
#define IS_FALSE 2
|
||||
#define IS_TRUE 3
|
||||
#define IS_LONG 4
|
||||
#define IS_DOUBLE 5
|
||||
#define IS_STRING 6
|
||||
#define IS_ARRAY 7
|
||||
#define IS_OBJECT 8
|
||||
#define IS_RESOURCE 9
|
||||
#define IS_REFERENCE 10
|
||||
#define IS_CONSTANT_AST 11 /* Constant expressions */
|
||||
enum {
|
||||
/* Regular data types: Must be in sync with zend_variables.c. */
|
||||
IS_UNDEF = 0,
|
||||
IS_NULL = 1,
|
||||
IS_FALSE = 2,
|
||||
IS_TRUE = 3,
|
||||
IS_LONG = 4,
|
||||
IS_DOUBLE = 5,
|
||||
IS_STRING = 6,
|
||||
IS_ARRAY = 7,
|
||||
IS_OBJECT = 8,
|
||||
IS_RESOURCE = 9,
|
||||
IS_REFERENCE = 10,
|
||||
IS_CONSTANT_AST = 11, /* Constant expressions */
|
||||
|
||||
/* Fake types used only for type hinting.
|
||||
/* Fake types used only for type hinting.
|
||||
* These are allowed to overlap with the types below. */
|
||||
#define IS_CALLABLE 12
|
||||
#define IS_ITERABLE 13
|
||||
#define IS_VOID 14
|
||||
#define IS_STATIC 15
|
||||
#define IS_MIXED 16
|
||||
#define IS_NEVER 17
|
||||
IS_CALLABLE = 12,
|
||||
IS_ITERABLE = 13,
|
||||
IS_VOID = 14,
|
||||
IS_STATIC = 15,
|
||||
IS_MIXED = 16,
|
||||
IS_NEVER = 17,
|
||||
|
||||
/* internal types */
|
||||
#define IS_INDIRECT 12
|
||||
#define IS_PTR 13
|
||||
#define IS_ALIAS_PTR 14
|
||||
#define _IS_ERROR 15
|
||||
/* internal types */
|
||||
IS_INDIRECT = 12,
|
||||
IS_PTR = 13,
|
||||
IS_ALIAS_PTR = 14,
|
||||
_IS_ERROR = 15,
|
||||
|
||||
/* used for casts */
|
||||
#define _IS_BOOL 18
|
||||
#define _IS_NUMBER 19
|
||||
/* used for casts */
|
||||
_IS_BOOL = 18,
|
||||
_IS_NUMBER = 19,
|
||||
};
|
||||
|
||||
#define ZEND_SAME_FAKE_TYPE(faketype, realtype) ( \
|
||||
(faketype) == (realtype) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue