Re: ArrayAccess::offsetGet not returning a ref
| From: | Gustavo Lopes | Date: | Fri, 06 Aug 2010 15:24:22 +0000 |
| Subject: | Re: ArrayAccess::offsetGet not returning a ref | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-49218@lists.php.net to get a copy of this message | ||
On Fri, 06 Aug 2010 15:50:33 +0100, Ralph Schindler <ralph@smashlabs.com> wrote:
The attached patch is the suggested fix. I made this against master on github.In my opinion, it would make more sense, as was already suggested before, to require the return to be passed by reference only if the prototype specifies it should be passed by reference. This could be argued to be a form of return contravariance. As a bonus, it would be consistent with the "pass_rest_by_reference" flag check: if (proto->common.pass_rest_by_reference && !fe->common.pass_rest_by_reference) { return 0; } //if (fe->common.return_reference != proto->common.return_reference) { if (proto->common.return_reference && !fe->common.return_reference) { return 0; } -- Gustavo Lopes