com php-src: Fix bug #60022: NEWS Zend/tests/ns_033.p hpt Zend/zend_compile.c Zend/zend_compile.h Zend/ zend_language_parser.y

From: Date: Mon, 06 Apr 2015 20:03:04 +0000
Subject: com php-src: Fix bug #60022: NEWS Zend/tests/ns_033.p hpt Zend/zend_compile.c Zend/zend_compile.h Zend/ zend_language_parser.y
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-86112@lists.php.net to get a copy of this message
Commit: cc70a46525f72340061107ced390eba3be1bf12a Author: Nikita Popov <nikic@php.net> Mon, 6 Apr 2015 22:03:04 +0200 Parents: 160dbe91a9e2767156c11f90a7c73eaae7f52e12 Branches: PHP-5.5 PHP-5.6 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cc70a46525f72340061107ced390eba3be1bf12a Log: Fix bug #60022 Bugs: https://bugs.php.net/60022 Changed paths: M NEWS M Zend/tests/ns_033.phpt M Zend/zend_compile.c M Zend/zend_compile.h M Zend/zend_language_parser.y Diff: diff --git a/NEWS b/NEWS index 3e5dcce..53b8776 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ PHP NEWS ?? ??? 2015, PHP 5.5.25 - Core: + . Fixed bug #60022 ("use statement [...] has no effect" depends on leading + backslash). (Nikita) . Fixed bug #68652 (segmentation fault in destructor). (Dmitry) - cURL: diff --git a/Zend/tests/ns_033.phpt b/Zend/tests/ns_033.phpt index dc431d8..ba40683 100644 --- a/Zend/tests/ns_033.phpt +++ b/Zend/tests/ns_033.phpt @@ -3,6 +3,8 @@ --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 diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 04f17ba..94566a5 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -7014,7 +7014,7 @@ void zend_do_begin_namespace(const znode *name, zend_bool with_bracket TSRMLS_DC } /* }}} */ -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; @@ -7042,7 +7042,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 && !CG(current_namespace); + warn = !CG(current_namespace); } } diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 08c11a7..2d88334 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -635,7 +635,7 @@ void zend_do_build_namespace_name(znode *result, znode *prefix, znode *name TSRM 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_resolve_class_name(znode *result, znode *class_name, int is_static TSRMLS_DC); diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y index 6d8c355...2926c8c 100644 --- a/Zend/zend_language_parser.y +++ b/Zend/zend_language_parser.y @@ -249,10 +249,10 @@ use_declarations: ; 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:

« previous php.cvs (#86112) next »