php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #66773
Patch bug66773.diff revision 2016-01-13 10:06 UTC by dmitry at zend dot com

Patch bug66773.diff for opcache Bug #66773

Patch version 2016-01-13 10:06 UTC

Return to Bug #66773 | Download this patch
Patch Revisions:

Developer: dmitry@zend.com

diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 1c30b98..f96e1ff 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -5485,12 +5485,14 @@ void zend_compile_use(zend_ast *ast) /* {{{ */
 		}
 
 		if (current_ns) {
+			zend_class_entry *ce;
 			zend_string *ns_name = zend_string_alloc(ZSTR_LEN(current_ns) + 1 + ZSTR_LEN(new_name), 0);
 			zend_str_tolower_copy(ZSTR_VAL(ns_name), ZSTR_VAL(current_ns), ZSTR_LEN(current_ns));
 			ZSTR_VAL(ns_name)[ZSTR_LEN(current_ns)] = '\\';
 			memcpy(ZSTR_VAL(ns_name) + ZSTR_LEN(current_ns) + 1, ZSTR_VAL(lookup_name), ZSTR_LEN(lookup_name));
 
-			if (zend_hash_exists(CG(class_table), ns_name)) {
+			ce = zend_hash_find_ptr(CG(class_table), ns_name);
+			if (ce && ce->type == ZEND_USER_CLASS && ce->info.user.filename == CG(compiled_filename)) {
 				zend_check_already_in_use(type, old_name, new_name, ns_name);
 			}
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 13:01:29 2024 UTC