diff options
author | Kalle Sommer Nielsen <kalle@php.net> | 2015-03-25 06:31:11 +0100 |
---|---|---|
committer | Kalle Sommer Nielsen <kalle@php.net> | 2015-03-25 06:31:11 +0100 |
commit | 927d53fda428205f0ec620d145890091069d8f75 (patch) | |
tree | 7986d1b9460e02787aa490bed01514bd2e0b1a3f /Zend/zend_builtin_functions.c | |
parent | a3d2f9b600c11a651961e00013a682d4d07ce401 (diff) | |
download | php-git-927d53fda428205f0ec620d145890091069d8f75.tar.gz |
Change "Cannot redeclare class X" into "Cannot redeclare class/interface/trait X", meaning that the following:
C:\> php -r "trait A { } trait A { }"
Will now properly print "Cannot redeclare trait A" instead of "Cannot redeclare class A" to make error messages a tiny bit clearer. Admittedly, a better solution can most likely be made by actually telling what the colliding object is a type of.
Internally this adds a new function:
zend_get_object_type()
Diffstat (limited to 'Zend/zend_builtin_functions.c')
-rw-r--r-- | Zend/zend_builtin_functions.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index a620e45a65..ecb9078db0 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -1536,7 +1536,7 @@ ZEND_FUNCTION(class_alias) if (zend_register_class_alias_ex(alias_name, alias_name_len, ce) == SUCCESS) { RETURN_TRUE; } else { - zend_error(E_WARNING, "Cannot redeclare class %s", alias_name); + zend_error(E_WARNING, "Cannot redeclare %s %s", zend_get_object_type(ce), alias_name); RETURN_FALSE; } } else { |