1 /* 2 +----------------------------------------------------------------------+ 3 | Zend Engine | 4 +----------------------------------------------------------------------+ 5 | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | 6 +----------------------------------------------------------------------+ 7 | This source file is subject to version 2.00 of the Zend license, | 8 | that is bundled with this package in the file LICENSE, and is | 9 | available through the world-wide-web at the following url: | 10 | http://www.zend.com/license/2_00.txt. | 11 | If you did not receive a copy of the Zend license and are unable to | 12 | obtain it through the world-wide-web, please send a note to | 13 | license@zend.com so we can mail you a copy immediately. | 14 +----------------------------------------------------------------------+ 15 | Authors: Dmitry Stogov <dmitry@php.net> | 16 +----------------------------------------------------------------------+ 17 */ 18 19 #ifndef ZEND_TYPE_INFO_H 20 #define ZEND_TYPE_INFO_H 21 22 #include "zend_types.h" 23 24 #define MAY_BE_UNDEF (1 << IS_UNDEF) 25 #define MAY_BE_NULL (1 << IS_NULL) 26 #define MAY_BE_FALSE (1 << IS_FALSE) 27 #define MAY_BE_TRUE (1 << IS_TRUE) 28 #define MAY_BE_BOOL (MAY_BE_FALSE|MAY_BE_TRUE) 29 #define MAY_BE_LONG (1 << IS_LONG) 30 #define MAY_BE_DOUBLE (1 << IS_DOUBLE) 31 #define MAY_BE_STRING (1 << IS_STRING) 32 #define MAY_BE_ARRAY (1 << IS_ARRAY) 33 #define MAY_BE_OBJECT (1 << IS_OBJECT) 34 #define MAY_BE_RESOURCE (1 << IS_RESOURCE) 35 #define MAY_BE_ANY (MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE) 36 #define MAY_BE_REF (1 << IS_REFERENCE) /* may be reference */ 37 38 /* These are used in zend_type, but not for type inference. 39 * They are allowed to overlap with types used during inference. */ 40 #define MAY_BE_CALLABLE (1 << IS_CALLABLE) 41 #define MAY_BE_ITERABLE (1 << IS_ITERABLE) 42 #define MAY_BE_VOID (1 << IS_VOID) 43 #define MAY_BE_STATIC (1 << IS_STATIC) 44 45 #define MAY_BE_ARRAY_SHIFT (IS_REFERENCE) 46 47 #define MAY_BE_ARRAY_OF_NULL (MAY_BE_NULL << MAY_BE_ARRAY_SHIFT) 48 #define MAY_BE_ARRAY_OF_FALSE (MAY_BE_FALSE << MAY_BE_ARRAY_SHIFT) 49 #define MAY_BE_ARRAY_OF_TRUE (MAY_BE_TRUE << MAY_BE_ARRAY_SHIFT) 50 #define MAY_BE_ARRAY_OF_LONG (MAY_BE_LONG << MAY_BE_ARRAY_SHIFT) 51 #define MAY_BE_ARRAY_OF_DOUBLE (MAY_BE_DOUBLE << MAY_BE_ARRAY_SHIFT) 52 #define MAY_BE_ARRAY_OF_STRING (MAY_BE_STRING << MAY_BE_ARRAY_SHIFT) 53 #define MAY_BE_ARRAY_OF_ARRAY (MAY_BE_ARRAY << MAY_BE_ARRAY_SHIFT) 54 #define MAY_BE_ARRAY_OF_OBJECT (MAY_BE_OBJECT << MAY_BE_ARRAY_SHIFT) 55 #define MAY_BE_ARRAY_OF_RESOURCE (MAY_BE_RESOURCE << MAY_BE_ARRAY_SHIFT) 56 #define MAY_BE_ARRAY_OF_ANY (MAY_BE_ANY << MAY_BE_ARRAY_SHIFT) 57 #define MAY_BE_ARRAY_OF_REF (MAY_BE_REF << MAY_BE_ARRAY_SHIFT) 58 59 #define MAY_BE_ARRAY_PACKED (1<<21) 60 #define MAY_BE_ARRAY_HASH (1<<22) /* hash with numeric keys */ 61 62 #define MAY_BE_ARRAY_KEY_LONG (MAY_BE_ARRAY_PACKED | MAY_BE_ARRAY_HASH) 63 #define MAY_BE_ARRAY_KEY_STRING (1<<23) 64 #define MAY_BE_ARRAY_KEY_ANY (MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_KEY_STRING) 65 66 #define MAY_BE_CLASS (1<<24) 67 #define MAY_BE_INDIRECT (1<<25) 68 69 70 #define MAY_BE_ANY_ARRAY \ 71 (MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_ANY|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF) 72 73 #endif /* ZEND_TYPE_INFO_H */ 74