[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-cvs
Subject:    [PHP-CVS] com php-src: Allow arrays + object access for new expressions: =?UTF-8?Q?Zend/zend=5Flangu
From:       Nikita Popov <nikic () php ! net>
Date:       2014-05-30 22:37:03
Message-ID: php-mail-1afa5c6a4f933ade4742b968ea5a160b1238698575 () git ! php ! net
[Download RAW message or body]

Commit:    ff475e9e763ffc74c8c63d26b3d5c9f37c702904
Author:    Nikita Popov <nikic@php.net>         Sat, 31 May 2014 00:37:03 +0200
Parents:   75c0db1119eb8b9a1bb414725d1abd1687511640
Branches:  master

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


Log:
Allow arrays + object access for new expressions

Changed paths:
  M  Zend/zend_language_parser.y


Diff:
diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y
index 1b20263..04455ca 100644
--- a/Zend/zend_language_parser.y
+++ b/Zend/zend_language_parser.y
@@ -902,7 +902,7 @@ class_name_reference:
 
 
 dynamic_class_name_reference:
-		simple_variable			{ zend_do_begin_variable_parse(TSRMLS_C); \
fetch_simple_variable(&$$, &$1, 1 TSRMLS_CC); } +		new_variable { $$ = $1; }
 ;
 
 exit_expr:
@@ -1104,6 +1104,15 @@ static_member:
 
 ;
 
+new_variable:
+		simple_variable
+			{ zend_do_begin_variable_parse(TSRMLS_C);
+			  fetch_simple_variable(&$$, &$1, 1 TSRMLS_CC); }
+	|	new_variable '[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$3 TSRMLS_CC); }
+	|	new_variable '{' expr '}' { fetch_string_offset(&$$, &$1, &$3 TSRMLS_CC); }
+	|	new_variable T_OBJECT_OPERATOR object_member
+			{ zend_do_fetch_property(&$$, &$1, &$3 TSRMLS_CC); }
+;
 
 dim_offset:
 		/* empty */		{ $$.op_type = IS_UNUSED; }


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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic