diff options
| author | Marcus Boerger <helly@php.net> | 2003-11-24 20:57:54 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2003-11-24 20:57:54 +0000 |
| commit | 4dba05d9cc5bf3a03915eed4ec3f72621df6df26 (patch) | |
| tree | f81804756353e355c8e7ec65c83d672e403416e8 /Zend/zend_operators.c | |
| parent | bc4d0082d682513770c99c15a4053f1411e79d73 (diff) | |
| download | php-git-4dba05d9cc5bf3a03915eed4ec3f72621df6df26.tar.gz | |
Add new interface ArrayAccess to use objects as Arrays
Diffstat (limited to 'Zend/zend_operators.c')
| -rw-r--r-- | Zend/zend_operators.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 6b581138e3..8a6f78e645 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -1410,7 +1410,7 @@ ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSR } -ZEND_API zend_bool instanceof_function(zend_class_entry *instance_ce, zend_class_entry *ce TSRMLS_DC) +ZEND_API zend_bool instanceof_function_ex(zend_class_entry *instance_ce, zend_class_entry *ce, zend_bool interfaces_only TSRMLS_DC) { zend_uint i; @@ -1419,16 +1419,23 @@ ZEND_API zend_bool instanceof_function(zend_class_entry *instance_ce, zend_class return 1; } } - while (instance_ce) { - if (instance_ce == ce) { - return 1; + if (!interfaces_only) { + while (instance_ce) { + if (instance_ce == ce) { + return 1; + } + instance_ce = instance_ce->parent; } - instance_ce = instance_ce->parent; } return 0; } +ZEND_API zend_bool instanceof_function(zend_class_entry *instance_ce, zend_class_entry *ce TSRMLS_DC) +{ + return instanceof_function_ex(instance_ce, ce, 0 TSRMLS_CC); +} + #define LOWER_CASE 1 #define UPPER_CASE 2 #define NUMERIC 3 |
