Skip to content

Commit 98e4ecb

Browse files
committed
fix Zend/tests/ns_040.phpt failing
It was wrongly assumed the namespace has to be looked up in a case sensitive manner too. Fixed the lookup to use a lower case represenation of the import name.
1 parent 612e77e commit 98e4ecb

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Zend/zend_compile.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2140,11 +2140,8 @@ void zend_resolve_non_class_name(znode *element_name, zend_bool *check_namespace
21402140

21412141
if (compound && CG(current_import)) {
21422142
len = compound - Z_STRVAL(element_name->u.constant);
2143-
if (case_sensitive) {
2144-
lookup_name = estrndup(Z_STRVAL(element_name->u.constant), len);
2145-
} else {
2146-
lookup_name = zend_str_tolower_dup(Z_STRVAL(element_name->u.constant), len);
2147-
}
2143+
/* namespace is always lowercase */
2144+
lookup_name = zend_str_tolower_dup(Z_STRVAL(element_name->u.constant), len);
21482145
/* Check if first part of compound name is an import name */
21492146
if (zend_hash_find(CG(current_import), lookup_name, len+1, (void**)&ns) == SUCCESS) {
21502147
/* Substitute import name */

0 commit comments

Comments
 (0)