diff options
| author | Harald Radi <phanto@php.net> | 2002-04-22 14:22:27 +0000 |
|---|---|---|
| committer | Harald Radi <phanto@php.net> | 2002-04-22 14:22:27 +0000 |
| commit | 6ac6cb1040c6ccf1157cf8d8384be1cb074c9281 (patch) | |
| tree | 5714c26e375f3c3adaa32ac893552c0f85a970da /Zend/zend_builtin_functions.c | |
| parent | 6c491a565487f2219575f9d55e1cebf4f0b46654 (diff) | |
| download | php-git-6ac6cb1040c6ccf1157cf8d8384be1cb074c9281.tar.gz | |
added get_class_entry callback handler to the
object handlers structure
Diffstat (limited to 'Zend/zend_builtin_functions.c')
| -rw-r--r-- | Zend/zend_builtin_functions.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 8341bd7df3..a1a2797ca5 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -501,9 +501,16 @@ ZEND_FUNCTION(get_class) RETURN_FALSE; } - if(Z_OBJ_HT_PP(arg)->get_class_name == NULL || + if (Z_OBJ_HT_PP(arg)->get_class_name == NULL || Z_OBJ_HT_PP(arg)->get_class_name(*arg, &name, &name_len, 0 TSRMLS_CC) != SUCCESS) { - RETURN_FALSE; + zend_class_entry *ce, **_ce; + + if (((_ce = zend_get_class_entry(*arg)) == NULL) || ((ce = *_ce) == NULL)) { + RETURN_FALSE; + } + + name = ce->name; + name_len = ce->name_length; } RETURN_STRINGL(name, name_len, 1); @@ -526,9 +533,16 @@ ZEND_FUNCTION(get_parent_class) char *name; zend_uint name_length; - if(Z_OBJ_HT_PP(arg)->get_class_name == NULL || + if (Z_OBJ_HT_PP(arg)->get_class_name == NULL || Z_OBJ_HT_PP(arg)->get_class_name(*arg, &name, &name_length, 1 TSRMLS_CC) != SUCCESS) { - RETURN_FALSE; + zend_class_entry *ce, **_ce; + + if (!(_ce = zend_get_class_entry(*arg)) || !(ce = *_ce) || !(ce = ce->parent)) { + RETURN_FALSE; + } + + name = ce->name; + name_length = ce->name_length; } RETURN_STRINGL(name, name_length, 1); } else if (Z_TYPE_PP(arg) == IS_STRING) { |
