Skip to content

Commit 602fef0

Browse files
committed
Clarify type of use in error messages
1 parent e23ad4e commit 602fef0

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

Zend/tests/use_const/conflicting_use.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ namespace {
1818

1919
?>
2020
--EXPECTF--
21-
Fatal error: Cannot use bar\baz as baz because the name is already in use in %s on line %d
21+
Fatal error: Cannot use const bar\baz as baz because the name is already in use in %s on line %d

Zend/tests/use_function/case_insensivity.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ namespace {
1010

1111
?>
1212
--EXPECTF--
13-
Fatal error: Cannot use foo\BAR as BAR because the name is already in use in %s on line %d
13+
Fatal error: Cannot use function foo\BAR as BAR because the name is already in use in %s on line %d

Zend/tests/use_function/conflicting_use.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ namespace {
2222

2323
?>
2424
--EXPECTF--
25-
Fatal error: Cannot use bar\baz as baz because the name is already in use in %s on line %d
25+
Fatal error: Cannot use function bar\baz as baz because the name is already in use in %s on line %d

Zend/zend_compile.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7220,10 +7220,10 @@ void zend_do_use_non_class(znode *ns_name, znode *new_name, int is_global, const
72207220
}
72217221

72227222
if (zend_hash_add(current_import_sub, lookup_name, Z_STRLEN_P(name)+1, &ns, sizeof(zval*), NULL) != SUCCESS) {
7223-
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));
7223+
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));
72247224
}
72257225
if (warn) {
7226-
zend_error(E_WARNING, "The use statement with non-compound name '%s' has no effect", Z_STRVAL_P(name));
7226+
zend_error(E_WARNING, "The use %s statement with non-compound name '%s' has no effect", type, Z_STRVAL_P(name));
72277227
}
72287228
efree(lookup_name);
72297229
zval_dtor(name);

0 commit comments

Comments
 (0)