#37259 [WFx]: Bad error message for ArrayAccess return by reference
| From: | helly@php.net | Date: | Mon, 01 May 2006 16:11:18 +0000 |
| Subject: | #37259 [WFx]: Bad error message for ArrayAccess return by reference | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-96444@lists.php.net to get a copy of this message | ||
ID: 37259
Updated by: helly@php.net
Reported By: tbarstow at workflowbydesign dot com
Status: Wont fix
Bug Type: Feature/Change Request
Operating System: *
PHP Version: 5.*
New Comment:
Seems you are missing your own point. The error message and all related
is all based on the fact that ArrayAccess protocol (member function
signatures) are not capeable of handling references.
Previous Comments:
------------------------------------------------------------------------
[2006-05-01 15:44:45] tbarstow at workflowbydesign dot com
You didn't really read my bug report. This is a report about a PHP
generated error message, not the fact that ArrayAccess can't deal with
returning references. Please re-open the bug or provide a response
that actually relates to the bug I am reporting.
------------------------------------------------------------------------
[2006-05-01 15:37:10] helly@php.net
We cannot change this. We could only probably add something more, a new
additionaö inteface that can only deal with references. ...We coukd but
we don't.
------------------------------------------------------------------------
[2006-05-01 14:49:34] tbarstow at workflowbydesign dot com
Description:
------------
This is related to the issue with ArrayAccess not being able to return
by reference. See:
http://bugs.php.net/bug.php?id=32983
http://bugs.php.net/bug.php?id=34783
However this is NOT a re-post of the above referenced bug. Rather, I
am reporting a bug that relates to the error message that results from
this situation.
The error message reads: "Objects used as arrays in post/pre
increment/decrement must return values by reference".
Two issues with this:
1. It's not possible to do. "Objects used as arrays" cannot return
values by reference, as noted in the bugs referenced above.
2. This doesn't only happen in post/pre increment/decrement cases.
There are a couple of examples in the bugs linked above; others exist
as well (consider passing $array_access_object['foo'] to a function
that takes a reference, for example).
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37259&edit=1