diff options
| author | Felipe Pena <felipe@php.net> | 2010-12-10 23:58:33 +0000 |
|---|---|---|
| committer | Felipe Pena <felipe@php.net> | 2010-12-10 23:58:33 +0000 |
| commit | 9864040e354226e53c4adf74740a520604206166 (patch) | |
| tree | 4f4cc7567e82c8765e6039ea6e83f440b635320c /ext/spl/spl_array.c | |
| parent | cccba0fa4daed884cfa0aad39115f35acbdcbd50 (diff) | |
| download | php-git-9864040e354226e53c4adf74740a520604206166.tar.gz | |
- Fixed bug #53515 (property_exists incorrect on ArrayObject null and 0 values)
Diffstat (limited to 'ext/spl/spl_array.c')
| -rwxr-xr-x | ext/spl/spl_array.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index d355546cf1..eb39cca1f6 100755 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -579,8 +579,15 @@ static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *o switch(Z_TYPE_P(offset)) { case IS_STRING: if (check_empty) { - if (zend_symtable_find(spl_array_get_hash_table(intern, 0 TSRMLS_CC), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **) &tmp) != FAILURE && zend_is_true(*tmp)) { - return 1; + if (zend_symtable_find(spl_array_get_hash_table(intern, 0 TSRMLS_CC), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **) &tmp) != FAILURE) { + switch (check_empty) { + case 0: + return Z_TYPE_PP(tmp) != IS_NULL; + case 2: + return 1; + default: + return zend_is_true(*tmp); + } } return 0; } else { @@ -597,8 +604,15 @@ static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *o } if (check_empty) { HashTable *ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - if (zend_hash_index_find(ht, index, (void **)&tmp) != FAILURE && zend_is_true(*tmp)) { - return 1; + if (zend_hash_index_find(ht, index, (void **)&tmp) != FAILURE) { + switch (check_empty) { + case 0: + return Z_TYPE_PP(tmp) != IS_NULL; + case 2: + return 1; + default: + return zend_is_true(*tmp); + } } return 0; } else { |
