#42140 [Bgs->Opn]: comma expression doesn't work outside for operator
| From: | dmitry at rsl dot ru | Date: | Sun, 29 Jul 2007 16:06:34 +0000 |
| Subject: | #42140 [Bgs->Opn]: comma expression doesn't work outside for operator | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-115534@lists.php.net to get a copy of this message | ||
ID: 42140
User updated by: dmitry at rsl dot ru
Reported By: dmitry at rsl dot ru
-Status: Bogus
+Status: Open
Bug Type: Scripting Engine problem
Operating System: linux
PHP Version: 5.2.3
New Comment:
Actually documentation has nothing about comma expression, the only way
to know about it is to view example 4 of 'for' operator. Though, it is
also mentioned but not explained in Operator Precedence part of chapter
15.
Well, this syntax works inside 'for' structure, so it is supported, why
not to allow to use this syntax in other expressions also?
Previous Comments:
------------------------------------------------------------------------
[2007-07-29 15:26:46] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
This syntax is simply not supported, and that is expected.
------------------------------------------------------------------------
[2007-07-29 14:31:42] dmitry at rsl dot ru
Description:
------------
comma expression doesn't work outside for operator:
this works:
<? for($z = $a=2,$b=1;false;); echo "z=$z a=$a b=$b"; ?>
this doesn't:
<? $z = $a=2,$b=1; echo "z=$z a=$a b=$b"; ?>
Parse error: syntax error, unexpected ',' in /home/dmitry/x.php on line
1
Reproduce code:
---------------
<? $z = $a=2,$b=1; echo "z=$z a=$a b=$b"; ?>
Expected result:
----------------
z=2 a=2 b=1
Actual result:
--------------
Parse error: syntax error, unexpected ',' in /home/dmitry/x.php on line
1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42140&edit=1