Commit:    18e2b1a9a930d5ae15544c5a2beed6b20d58cdee
Author:    Bob Weinand <bobw...@hotmail.com>         Sun, 3 Nov 2013 12:28:00 
+0100
Parents:   ad967e1329ce25e80f485f77be1478f3676b9a37
Branches:  PHP-5.6

Link:       
http://git.php.net/?p=php-src.git;a=commitdiff;h=18e2b1a9a930d5ae15544c5a2beed6b20d58cdee

Log:
Removed operations on constant arrays.
They make no sense as constants are not allowed to be arrays.
And as just properties are allowed to; no problem, we still don't
need operations on any constant array.

Changed paths:
  M  Zend/zend_language_parser.y


Diff:
diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y
index 65e3e0c..19d6d83 100644
--- a/Zend/zend_language_parser.y
+++ b/Zend/zend_language_parser.y
@@ -952,7 +952,9 @@ static_class_constant:
 ;
 
 static_scalar: /* compile-time evaluated scalars */
-       static_scalar_value { $$ = $1; }
+               static_scalar_value { $$ = $1; }
+       |       T_ARRAY '(' static_array_pair_list ')' { $$ = $3; 
Z_TYPE($$.u.constant) = IS_CONSTANT_ARRAY; }
+       |       '[' static_array_pair_list ']' { $$ = $2; Z_TYPE($$.u.constant) 
= IS_CONSTANT_ARRAY; }
 ;
 
 static_scalar_value:
@@ -961,8 +963,6 @@ static_scalar_value:
        |       namespace_name          { zend_do_fetch_constant(&$$, NULL, 
&$1, ZEND_CT, 1 TSRMLS_CC); }
        |       T_NAMESPACE T_NS_SEPARATOR namespace_name { $$.op_type = 
IS_CONST; ZVAL_EMPTY_STRING(&$$.u.constant);  zend_do_build_namespace_name(&$$, 
&$$, &$3 TSRMLS_CC); $3 = $$; zend_do_fetch_constant(&$$, NULL, &$3, ZEND_CT, 0 
TSRMLS_CC); }
        |       T_NS_SEPARATOR namespace_name { char *tmp = 
estrndup(Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); memcpy(&(tmp[1]), 
Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); tmp[0] = '\\'; 
efree(Z_STRVAL($2.u.constant)); Z_STRVAL($2.u.constant) = tmp; 
++Z_STRLEN($2.u.constant); zend_do_fetch_constant(&$$, NULL, &$2, ZEND_CT, 0 
TSRMLS_CC); }
-       |       T_ARRAY '(' static_array_pair_list ')' { $$ = $3; 
Z_TYPE($$.u.constant) = IS_CONSTANT_ARRAY; }
-       |       '[' static_array_pair_list ']' { $$ = $2; Z_TYPE($$.u.constant) 
= IS_CONSTANT_ARRAY; }
        |       static_class_constant { $$ = $1; }
        |       T_CLASS_C                       { $$ = $1; }
        |       static_operation { $$ = $1; }


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to