Clarify type of use in error messages

This commit is contained in:
Igor Wiedler 2013-10-14 23:32:11 +02:00
parent e23ad4eeb2
commit 602fef0e52
4 changed files with 5 additions and 5 deletions

View file

@ -18,4 +18,4 @@ namespace {
?> ?>
--EXPECTF-- --EXPECTF--
Fatal error: Cannot use bar\baz as baz because the name is already in use in %s on line %d Fatal error: Cannot use const bar\baz as baz because the name is already in use in %s on line %d

View file

@ -10,4 +10,4 @@ namespace {
?> ?>
--EXPECTF-- --EXPECTF--
Fatal error: Cannot use foo\BAR as BAR because the name is already in use in %s on line %d Fatal error: Cannot use function foo\BAR as BAR because the name is already in use in %s on line %d

View file

@ -22,4 +22,4 @@ namespace {
?> ?>
--EXPECTF-- --EXPECTF--
Fatal error: Cannot use bar\baz as baz because the name is already in use in %s on line %d Fatal error: Cannot use function bar\baz as baz because the name is already in use in %s on line %d

View file

@ -7220,10 +7220,10 @@ void zend_do_use_non_class(znode *ns_name, znode *new_name, int is_global, const
} }
if (zend_hash_add(current_import_sub, lookup_name, Z_STRLEN_P(name)+1, &ns, sizeof(zval*), NULL) != SUCCESS) { if (zend_hash_add(current_import_sub, lookup_name, Z_STRLEN_P(name)+1, &ns, sizeof(zval*), NULL) != SUCCESS) {
zend_error(E_COMPILE_ERROR, "Cannot use %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name)); zend_error(E_COMPILE_ERROR, "Cannot use %s %s as %s because the name is already in use", type, Z_STRVAL_P(ns), Z_STRVAL_P(name));
} }
if (warn) { if (warn) {
zend_error(E_WARNING, "The use statement with non-compound name '%s' has no effect", Z_STRVAL_P(name)); zend_error(E_WARNING, "The use %s statement with non-compound name '%s' has no effect", type, Z_STRVAL_P(name));
} }
efree(lookup_name); efree(lookup_name);
zval_dtor(name); zval_dtor(name);