|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-06-21 10:41 UTC] othalla at wp dot pl
In zend_language_parser.y there is code:
[...]
static_scalar: /* compile-time evaluated scalars */
[...]
| '+' static_scalar { $$ = $1; }
[...]
but I think that schould be:
[...]
static_scalar: /* compile-time evaluated scalars */
[...]
| '+' static_scalar { $$ = $2; }
[...]
-----------------------------------------------------
$2 instead of $1
It's still in PHP 4.3.0-alpha tarball.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 20:00:02 2026 UTC |
This is in fact a bug, and changing the grammar file as suggested by othalla@wp.pl fixes this problem. Here is a diff to do it ... --- zend_language_parser.y Sat Jun 22 15:12:41 2002 +++ zend_language_parser.old Sat Jun 22 15:18:26 2002 @@ -608,7 +608,7 @@ static_scalar: /* compile-time evaluated scalars */ common_scalar { $$ = $1; } | T_STRING { zend_do_fetch_constant(&$$, NULL, &$1, ZEND_CT TSRMLS_CC); } - | '+' static_scalar { $$ = $2; } + | '+' static_scalar { $$ = $1; } | '-' static_scalar { zval minus_one; minus_one.type = IS_LONG; minus_one.value.lval = -1; mul_function(&$2.u.constant, &$2.u.constant, &minus_one TSRMLS_CC); $$ = $2; } | T_ARRAY '(' static_array_pair_list ')' { $$ = $3; $$.u.constant.type = IS_CONSTANT_ARRAY; } | parse_class_name_entry T_STRING { zend_do_fetch_constant(&$$, &$1, &$2, ZEND_CT TSRMLS_CC); }