com php-src: Forbid use() of auto-globals: Zend/zend_compile .c

From: Date: Tue, 29 Dec 2015 10:20:44 +0000
Subject: com php-src: Forbid use() of auto-globals: Zend/zend_compile .c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-90476@lists.php.net to get a copy of this message
Commit: 4440436821404ff3c76682726e63d1aaf381f73a Author: Nikita Popov <nikic@php.net> Tue, 29 Dec 2015 11:20:44 +0100 Parents: cb1db49d0a071a9ae89c930ee7efa4a68b742972 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4440436821404ff3c76682726e63d1aaf381f73a Log: Forbid use() of auto-globals We don't correctly support it, it doesn't make sense and it's also forbidden for parameters. Changed paths: M Zend/zend_compile.c Diff: diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 97be4b9..3a7e0b5 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -4908,6 +4908,10 @@ void zend_compile_closure_uses(zend_ast *ast) /* {{{ */ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use $this as lexical variable"); } + if (zend_is_auto_global(name)) { + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use auto-global as lexical variable"); + } + ZVAL_NULL(&zv); Z_CONST_FLAGS(zv) = by_ref ? IS_LEXICAL_REF : IS_LEXICAL_VAR;

« previous php.cvs (#90476) next »