forked from zenovich/runkit
-
Notifications
You must be signed in to change notification settings - Fork 27
/
php_runkit_zval.h
40 lines (36 loc) · 1.58 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
/*
+----------------------------------------------------------------------+
| (c) 2008-2015 Dmitry Zenovich |
| "runkit7" patches (c) 2015-2020 Tyson Andre |
+----------------------------------------------------------------------+
| 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 |
| or at https://github.com/runkit7/runkit7/blob/master/LICENSE |
+----------------------------------------------------------------------+
| Author: Dmitry Zenovich <dzenovich@gmail.com> |
| Modified for php7 "runkit7" by Tyson Andre<tysonandre775@hotmail.com>|
+----------------------------------------------------------------------+
*/
#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 *p, zend_class_entry *ce)
{
if (Z_CONSTANT_P(p)) {
// TODO: What does this do?
// TODO: Make a copy if (Z_TYPE_FLAGS_P(p) & IS_TYPE_IMMUTABLE) != 0, test this out?
zval_update_constant_ex(p, ce);
}
}
/* }}} */
#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