diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-09-23 16:53:54 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-09-23 16:53:54 +0200 |
commit | 6276dd826b30c91bb95fc59846794617f9b4dd64 (patch) | |
tree | 95640cd7b7dfb1d9c6be5b1e3d56d19e53ce55c6 /ext/reflection/php_reflection.c | |
parent | 3a104c3c3736cc7b9fc0190477b0d631032b3d80 (diff) | |
download | php-git-6276dd826b30c91bb95fc59846794617f9b4dd64.tar.gz |
Use ZEND_TYPE_IS_SET() when checking for property types
Instead of a simple if or 0 comparison. This would no longer work
if zend_type is a struct.
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 92723240e9..a6aa982f0d 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -3703,7 +3703,7 @@ static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value } else if (!statics && (prop_info->flags & ZEND_ACC_STATIC) == 0) { prop = &ce->default_properties_table[OBJ_PROP_TO_NUM(prop_info->offset)]; } - if (!prop || (prop_info->type && Z_ISUNDEF_P(prop))) { + if (!prop || (ZEND_TYPE_IS_SET(prop_info->type) && Z_ISUNDEF_P(prop))) { continue; } @@ -3815,7 +3815,7 @@ ZEND_METHOD(reflection_class, setStaticPropertyValue) } } - if (prop_info->type && !zend_verify_property_type(prop_info, value, 0)) { + if (ZEND_TYPE_IS_SET(prop_info->type) && !zend_verify_property_type(prop_info, value, 0)) { return; } |