File tree 6 files changed +63
-39
lines changed
6 files changed +63
-39
lines changed Original file line number Diff line number Diff line change 39
39
#include "zend_smart_str_public.h"
40
40
#include "zend_smart_string_public.h"
41
41
#include "zend_signal.h"
42
+ #include "zend_type_code.h"
42
43
43
44
#define zend_sprintf sprintf
44
45
Original file line number Diff line number Diff line change 28
28
#include "zend_variables.h"
29
29
#include "zend_execute.h"
30
30
#include "zend_type_info.h"
31
-
31
+ #include "zend_type_code.h"
32
32
33
33
BEGIN_EXTERN_C ()
34
34
Original file line number Diff line number Diff line change 24
24
#include "zend_compile.h"
25
25
#include "zend_hash.h"
26
26
#include "zend_operators.h"
27
+ #include "zend_type_code.h"
27
28
#include "zend_variables.h"
28
29
29
30
#include <stdint.h>
Original file line number Diff line number Diff line change 23
23
24
24
#include "zend.h"
25
25
#include "zend_sort.h"
26
+ #include "zend_type_code.h"
26
27
27
28
#define HASH_KEY_IS_STRING 1
28
29
#define HASH_KEY_IS_LONG 2
Original file line number Diff line number Diff line change
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
+ */
16
+
17
+ #ifndef ZEND_TYPE_CODE_H
18
+ #define ZEND_TYPE_CODE_H
19
+
20
+ /* Regular data types: Must be in sync with zend_variables.c. */
21
+ #define IS_UNDEF 0
22
+ #define IS_NULL 1
23
+ #define IS_FALSE 2
24
+ #define IS_TRUE 3
25
+ #define IS_LONG 4
26
+ #define IS_DOUBLE 5
27
+ #define IS_STRING 6
28
+ #define IS_ARRAY 7
29
+ #define IS_OBJECT 8
30
+ #define IS_RESOURCE 9
31
+ #define IS_REFERENCE 10
32
+ #define IS_CONSTANT_AST 11 /* Constant expressions */
33
+
34
+ /* Fake types used only for type hinting.
35
+ * These are allowed to overlap with the types below. */
36
+ #define IS_CALLABLE 12
37
+ #define IS_ITERABLE 13
38
+ #define IS_VOID 14
39
+ #define IS_STATIC 15
40
+ #define IS_MIXED 16
41
+ #define IS_NEVER 17
42
+
43
+ /* internal types */
44
+ #define IS_INDIRECT 12
45
+ #define IS_PTR 13
46
+ #define IS_ALIAS_PTR 14
47
+ #define _IS_ERROR 15
48
+
49
+ /* used for casts */
50
+ #define _IS_BOOL 18
51
+ #define _IS_NUMBER 19
52
+
53
+ #define ZEND_SAME_FAKE_TYPE (faketype , realtype ) ( \
54
+ (faketype) == (realtype) \
55
+ || ((faketype) == _IS_BOOL && ((realtype) == IS_TRUE || (realtype) == IS_FALSE)) \
56
+ )
57
+
58
+ #endif /* ZEND_TYPE_CODE_H */
Original file line number Diff line number Diff line change 26
26
#include "zend_long.h"
27
27
#include "zend_rc_debug.h"
28
28
#include "zend_result.h"
29
+ #include "zend_type_code.h"
29
30
30
31
#include <stdbool.h>
31
32
#include <stdint.h>
@@ -538,48 +539,10 @@ struct _zend_ast_ref {
538
539
/*zend_ast ast; zend_ast follows the zend_ast_ref structure */
539
540
};
540
541
541
- /* Regular data types: Must be in sync with zend_variables.c. */
542
- #define IS_UNDEF 0
543
- #define IS_NULL 1
544
- #define IS_FALSE 2
545
- #define IS_TRUE 3
546
- #define IS_LONG 4
547
- #define IS_DOUBLE 5
548
- #define IS_STRING 6
549
- #define IS_ARRAY 7
550
- #define IS_OBJECT 8
551
- #define IS_RESOURCE 9
552
- #define IS_REFERENCE 10
553
- #define IS_CONSTANT_AST 11 /* Constant expressions */
554
-
555
- /* Fake types used only for type hinting.
556
- * These are allowed to overlap with the types below. */
557
- #define IS_CALLABLE 12
558
- #define IS_ITERABLE 13
559
- #define IS_VOID 14
560
- #define IS_STATIC 15
561
- #define IS_MIXED 16
562
- #define IS_NEVER 17
563
-
564
- /* internal types */
565
- #define IS_INDIRECT 12
566
- #define IS_PTR 13
567
- #define IS_ALIAS_PTR 14
568
- #define _IS_ERROR 15
569
-
570
- /* used for casts */
571
- #define _IS_BOOL 18
572
- #define _IS_NUMBER 19
573
-
574
542
static zend_always_inline uint8_t zval_get_type (const zval * pz ) {
575
543
return pz -> u1 .v .type ;
576
544
}
577
545
578
- #define ZEND_SAME_FAKE_TYPE (faketype , realtype ) ( \
579
- (faketype) == (realtype) \
580
- || ((faketype) == _IS_BOOL && ((realtype) == IS_TRUE || (realtype) == IS_FALSE)) \
581
- )
582
-
583
546
/* we should never set just Z_TYPE, we should set Z_TYPE_INFO */
584
547
#define Z_TYPE (zval ) zval_get_type(&(zval))
585
548
#define Z_TYPE_P (zval_p ) Z_TYPE(*(zval_p))
You can’t perform that action at this time.
0 commit comments