-
Notifications
You must be signed in to change notification settings - Fork 136
/
php_runkit_zval.h
49 lines (44 loc) · 1.9 KB
/
php_runkit_zval.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| (c) 2008-2015 Dmitry Zenovich |
+----------------------------------------------------------------------+
| This source file is subject to the new BSD license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.opensource.org/licenses/BSD-3-Clause |
| If you did not receive a copy of the license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| [email protected] so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Dmitry Zenovich <[email protected]> |
+----------------------------------------------------------------------+
*/
#ifndef PHP_RUNKIT_ZVAL_H
#define PHP_RUNKIT_ZVAL_H
/* {{{ php_runkit_zval_resolve_class_constant */
inline static void php_runkit_zval_resolve_class_constant(zval **pp, zend_class_entry *ce TSRMLS_DC) {
if (
Z_TYPE_PP(pp) == IS_CONSTANT_AST
#if RUNKIT_ABOVE53
|| (Z_TYPE_PP(pp) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT
#endif
) {
#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 2) || (PHP_MAJOR_VERSION > 5)
zval_update_constant_ex(pp, PHP_RUNKIT_CONSTANT_INDEX(1), ce TSRMLS_CC);
#else
zval_update_constant(pp, ce TSRMLS_CC);
#endif
}
}
/* }}} */
#define PHP_RUNKIT_ZVAL_CONVERT_TO_STRING_IF_NEEDED(val, val_copy) \
if (Z_TYPE_P(member) != IS_STRING) { \
val_copy = *val; \
val = &val_copy; \
zval_copy_ctor(val); \
val->RUNKIT_REFCOUNT = 1; \
convert_to_string(val); \
}
#endif