diff options
author | Marcus Boerger <helly@php.net> | 2005-05-02 16:18:02 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2005-05-02 16:18:02 +0000 |
commit | 56d543c161ab6df9f52930881d96486865cd452a (patch) | |
tree | e5c62bc117ff9bcd8619901a561a4f0fcff60ecd /Zend/zend_object_handlers.c | |
parent | 138c5457ac35047c63be6608c35a4e2798c0bc12 (diff) | |
download | php-git-56d543c161ab6df9f52930881d96486865cd452a.tar.gz |
- Extend API to support real existance test without the need to add any new
functions or change any behavior
Diffstat (limited to 'Zend/zend_object_handlers.c')
-rw-r--r-- | Zend/zend_object_handlers.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 91faa67cfa..dc9a1b9106 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -806,8 +806,7 @@ static int zend_std_compare_objects(zval *o1, zval *o2 TSRMLS_DC) return zend_compare_symbol_tables_i(zobj1->properties, zobj2->properties TSRMLS_CC); } - -static int zend_std_has_property(zval *object, zval *member, int check_empty TSRMLS_DC) +static int zend_std_has_property(zval *object, zval *member, int has_set_exists TSRMLS_DC) { zend_object *zobj; int result; @@ -833,10 +832,16 @@ static int zend_std_has_property(zval *object, zval *member, int check_empty TSR } if (zend_hash_find(zobj->properties, property_info->name, property_info->name_length+1, (void **) &value) == SUCCESS) { - if (check_empty) { - result = zend_is_true(*value); - } else { + switch (has_set_exists) { + case 0: result = (Z_TYPE_PP(value) != IS_NULL); + break; + default: + result = zend_is_true(*value); + break; + case 2: + result = 1; + break; } } else { result = 0; |