]> granicus.if.org Git - php/commitdiff
Fixed bug #46755 (warning: use statement with non-compound name)
authorDmitry Stogov <dmitry@php.net>
Wed, 14 Jan 2009 13:57:59 +0000 (13:57 +0000)
committerDmitry Stogov <dmitry@php.net>
Wed, 14 Jan 2009 13:57:59 +0000 (13:57 +0000)
Fixed bug #46979 (use with non-compound name *has* effect)

Zend/zend_compile.c

index f12b6ec5234059e7eb23b47140699a6cd556bc20..2e002a012a60792d189b025eb6d2b68bac998f2f 100644 (file)
@@ -5548,7 +5548,7 @@ void zend_do_use(znode *ns_name, znode *new_name, int is_global TSRMLS_DC) /* {{
                        } else {
                                *name = *ns;
                                zval_copy_ctor(name);
-                               warn = !is_global;
+                               warn = !is_global && !CG(current_namespace);
                        }
                } else {
                        char *p = zend_memrchr(Z_STRVAL_P(ns), '\\', Z_STRLEN_P(ns));
@@ -5557,7 +5557,7 @@ void zend_do_use(znode *ns_name, znode *new_name, int is_global TSRMLS_DC) /* {{
                        } else {
                                *name = *ns;
                                zval_copy_ctor(name);
-                               warn = !is_global;
+                               warn = !is_global && !CG(current_namespace);
                        }
                }
        }