diff options
author | Marcus Boerger <helly@php.net> | 2004-03-16 10:14:57 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2004-03-16 10:14:57 +0000 |
commit | 09e76476eff44df478ce287648cb80ad5bbfa7fc (patch) | |
tree | 6f770bb0875506498d10354c0732d75debec18d2 /Zend/zend_execute_API.c | |
parent | 3b2f56275a1218085456b606b4190e048599b625 (diff) | |
download | php-git-09e76476eff44df478ce287648cb80ad5bbfa7fc.tar.gz |
Improve error message
Diffstat (limited to 'Zend/zend_execute_API.c')
-rw-r--r-- | Zend/zend_execute_API.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index c2ea664636..7f4b1f7f33 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -297,6 +297,35 @@ void shutdown_executor(TSRMLS_D) } +/* return class name and "::" or "". */ +ZEND_API char *get_active_class_name(char **space TSRMLS_DC) +{ + if (!zend_is_executing(TSRMLS_C)) { + if (space) { + *space = ""; + } + return ""; + } + switch (EG(function_state_ptr)->function->type) { + case ZEND_USER_FUNCTION: + case ZEND_INTERNAL_FUNCTION: + { + zend_class_entry *ce = EG(function_state_ptr)->function->common.scope; + + if (space) { + *space = ce ? "::" : ""; + } + return ce ? ce->name : ""; + } + default: + if (space) { + *space = ""; + } + return ""; + } +} + + ZEND_API char *get_active_function_name(TSRMLS_D) { if (!zend_is_executing(TSRMLS_C)) { |