ID:               37259
 User updated by:  tbarstow at workflowbydesign dot com
 Reported By:      tbarstow at workflowbydesign dot com
 Status:           Wont fix
 Bug Type:         Feature/Change Request
 Operating System: *
 PHP Version:      5.*
 New Comment:

Not really missing my own point.  There are two points, neither of
which is addressed:

1. The error message seems to be instructive (perhaps this is a
language barrier issue).  It seems to say (to me, anyway), "go and
rewrite your array access object to return by reference", which as we
both know is impossible.
2. The error message indicates that it is being thrown because of a
particular situation--pre/post increment/decrement--when in fact it can
occur when there is no increment/decrement happening at all.

The point is: this is a very confusing error message, and though I have
not inspected how error messages get generated by PHP, I am willing to
bet that this would be a very simple thing to change and thus make it
easier for PHP developers to understand what's going on (and perhaps
not post duplicate bugs about this over and over again).

Anyway thanks for your time.  PHP is great, and I love the SPL in
general.  I just wish there were some elegant way to use ArrayAccess in
pass-by-reference situations.


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

[2006-05-01 16:11:17] [EMAIL PROTECTED]

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.

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

[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] [EMAIL PROTECTED]

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

Reply via email to