com php-src: Disallow block mode for declare(strict_types =1) declarations: Zend/zend_compile.c

From: Date: Wed, 18 Feb 2015 17:43:57 +0000
Subject: com php-src: Disallow block mode for declare(strict_types =1) declarations: Zend/zend_compile.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-85696@lists.php.net to get a copy of this message
Commit: d5aaebc355f9865a818cb43c93afc3975dbb3213 Author: Anthony Ferrara <ircmaxell@gmail.com> Wed, 18 Feb 2015 12:43:57 -0500 Parents: 37604b45ba256541219a1038b033aed31432e5d7 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d5aaebc355f9865a818cb43c93afc3975dbb3213 Log: Disallow block mode for declare(strict_types=1) declarations Changed paths: M Zend/zend_compile.c Diff: diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index a13fab7..2c9c02d 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3898,6 +3898,11 @@ void zend_compile_declare(zend_ast *ast) /* {{{ */ "the very first statement in the script"); } + if (ast->child[1] != NULL) { + zend_error_noreturn(E_COMPILE_ERROR, "strict_types declaration must not " + "use block mode"); + } + zend_const_expr_to_zval(&value_zv, value_ast); if (Z_TYPE(value_zv) != IS_LONG || (Z_LVAL(value_zv) != 0 && Z_LVAL(value_zv) != 1)) {

« previous php.cvs (#85696) next »