ID:               46410
 Updated by:       [EMAIL PROTECTED]
 Reported By:      jbleau at gmail dot com
 Status:           Open
-Bug Type:         Scripting Engine problem
+Bug Type:         Feature/Change Request
 Operating System: *
 PHP Version:      5.2.6
 New Comment:





Previous Comments:
------------------------------------------------------------------------

[2008-10-29 04:57:02] jbleau at gmail dot com

Description:
------------
Assignments which should otherwise evaluate to references of the
l-value do not properly do so in some situations, but do in others.

Reproduce code:
---------------
1. echo ($x = 5)--;
2. echo ($x = Array(3))[0];
3. echo ($x = ($y = 3));

I presume this is also related:

4.
function foo(){ return Array(3); }
echo (foo())[0];

Expected result:
----------------
1. 4
2. 3
3. 3
4. 3

Actual result:
--------------
1. Parser chokes on T_DEC
2. Parser chokes on [
3. Works correctly, 3 is assigned to $x and $y and printed.
4. Parser chokes on [


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=46410&edit=1

Reply via email to