com php-src: Fix ('\bar')() in namespace: Zend/tests/dynamic_ fully_qualified_call.phpt Zend/zend_compile.c

From: Date: Sun, 01 May 2016 11:05:14 +0000
Subject: com php-src: Fix ('\bar')() in namespace: Zend/tests/dynamic_ fully_qualified_call.phpt Zend/zend_compile.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-91984@lists.php.net to get a copy of this message
Commit: d0069ca6c132f54631b67617a730cefb825589cb Author: Nikita Popov <nikic@php.net> Sun, 1 May 2016 13:04:08 +0200 Parents: 895337ddbdeb322da3c583ef7ea03b45d0c8282c Branches: PHP-7.0 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d0069ca6c132f54631b67617a730cefb825589cb Log: Fix ('\bar')() in namespace Changed paths: A Zend/tests/dynamic_fully_qualified_call.phpt M Zend/zend_compile.c Diff: diff --git a/Zend/tests/dynamic_fully_qualified_call.phpt b/Zend/tests/dynamic_fully_qualified_call.phpt new file mode 100644 index 0000000..cca6fa3 --- /dev/null +++ b/Zend/tests/dynamic_fully_qualified_call.phpt @@ -0,0 +1,15 @@ +--TEST-- +Crash when using dynamic call syntax with fully qualified name in a namespace +--FILE-- +<?php + +namespace Foo; +try { + ('\bar')(); +} catch (\Error $e) { + echo $e->getMessage(), "\n"; +} + +?> +--EXPECT-- +Call to undefined function bar() diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index fb196f0..c79f1d7 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -773,6 +773,7 @@ zend_string *zend_resolve_non_class_name( if (ZSTR_VAL(name)[0] == '\\') { /* Remove \ prefix (only relevant if this is a string rather than a label) */ + *is_fully_qualified = 1; return zend_string_init(ZSTR_VAL(name) + 1, ZSTR_LEN(name) - 1, 0); }

« previous php.cvs (#91984) next »