Update get_class_name semantics

* get_class_name is now only used for displaying the class name
   in debugging functions like var_dump, print_r, etc. It is no
   longer used in get_class() etc.
 * As it is no longer used in get_parent_class() the parent
   argument is now gone. This also fixes incorrect parent classes
   being reported in COM.
 * get_class_name is now always required (previously some places
   made it optional and some required it) and is also required
   to return a non-NULL value.
 * Remove zend_get_object_classname. This also fixes a number of
   potential leaks due to incorrect usage of this function.
This commit is contained in:
Nikita Popov 2014-10-09 19:15:07 +02:00
parent c061c82945
commit df79b9b27a
12 changed files with 32 additions and 96 deletions

View file

@ -89,11 +89,8 @@ ZEND_API void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */
{
#ifdef HAVE_DTRACE
if (DTRACE_EXCEPTION_THROWN_ENABLED()) {
zend_string *classname;
if (exception != NULL) {
classname = zend_get_object_classname(Z_OBJ_P(exception) TSRMLS_CC);
DTRACE_EXCEPTION_THROWN(classname->val);
DTRACE_EXCEPTION_THROWN(Z_OBJ_P(exception)->ce->val);
} else {
DTRACE_EXCEPTION_THROWN(NULL);
}
@ -452,7 +449,7 @@ static void _build_trace_args(zval *arg, smart_str *str TSRMLS_DC) /* {{{ */
break;
case IS_OBJECT:
smart_str_appends(str, "Object(");
smart_str_append(str, zend_get_object_classname(Z_OBJ_P(arg) TSRMLS_CC));
smart_str_append(str, Z_OBJCE_P(arg)->name);
smart_str_appends(str, "), ");
break;
}