php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #60022
Patch patch.txt revision 2011-10-11 09:04 UTC by nikic@php.net

Patch patch.txt for Scripting Engine problem Bug #60022

Patch version 2011-10-11 09:04 UTC

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

Developer: nikic@php.net

Index: Zend/zend_compile.c
===================================================================
--- Zend/zend_compile.c	(revision 318013)
+++ Zend/zend_compile.c	(working copy)
@@ -6753,7 +6753,7 @@
 }
 /* }}} */
 
-void zend_do_use(znode *ns_name, znode *new_name, int is_global TSRMLS_DC) /* {{{ */
+void zend_do_use(znode *ns_name, znode *new_name TSRMLS_DC) /* {{{ */
 {
 	char *lcname;
 	zval *name, *ns, tmp;
@@ -6781,7 +6781,7 @@
 		} else {
 			*name = *ns;
 			zval_copy_ctor(name);
-			warn = !is_global && !CG(current_namespace);
+			warn = !CG(current_namespace);
 		}
 	}
 
Index: Zend/zend_compile.h
===================================================================
--- Zend/zend_compile.h	(revision 318013)
+++ Zend/zend_compile.h	(working copy)
@@ -614,7 +614,7 @@
 void zend_do_begin_namespace(const znode *name, zend_bool with_brackets TSRMLS_DC);
 void zend_do_end_namespace(TSRMLS_D);
 void zend_verify_namespace(TSRMLS_D);
-void zend_do_use(znode *name, znode *new_name, int is_global TSRMLS_DC);
+void zend_do_use(znode *name, znode *new_name TSRMLS_DC);
 void zend_do_end_compilation(TSRMLS_D);
 
 void zend_do_label(znode *label TSRMLS_DC);
Index: Zend/tests/ns_033.phpt
===================================================================
--- Zend/tests/ns_033.phpt	(revision 318013)
+++ Zend/tests/ns_033.phpt	(working copy)
@@ -3,6 +3,10 @@
 --FILE--
 <?php
 use A;
+use \B;
+?>
 --EXPECTF--
 Warning: The use statement with non-compound name 'A' has no effect in %sns_033.php on line 2
 
+Warning: The use statement with non-compound name 'B' has no effect in %sns_033.php on line 3
+
Index: Zend/zend_language_parser.y
===================================================================
--- Zend/zend_language_parser.y	(revision 318013)
+++ Zend/zend_language_parser.y	(working copy)
@@ -244,10 +244,10 @@
 ;
 
 use_declaration:
-		namespace_name 			{ zend_do_use(&$1, NULL, 0 TSRMLS_CC); }
-	|	namespace_name T_AS T_STRING	{ zend_do_use(&$1, &$3, 0 TSRMLS_CC); }
-	|	T_NS_SEPARATOR namespace_name { zend_do_use(&$2, NULL, 1 TSRMLS_CC); }
-	|	T_NS_SEPARATOR namespace_name T_AS T_STRING { zend_do_use(&$2, &$4, 1 TSRMLS_CC); }
+		namespace_name 			{ zend_do_use(&$1, NULL TSRMLS_CC); }
+	|	namespace_name T_AS T_STRING	{ zend_do_use(&$1, &$3 TSRMLS_CC); }
+	|	T_NS_SEPARATOR namespace_name { zend_do_use(&$2, NULL TSRMLS_CC); }
+	|	T_NS_SEPARATOR namespace_name T_AS T_STRING { zend_do_use(&$2, &$4 TSRMLS_CC); }
 ;
 
 constant_declaration:
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Dec 06 00:01:23 2019 UTC