Re: [PATCH] disallow arguments by ref in magic methods
| From: | Antony Dovgal | Date: | Fri, 31 Aug 2007 12:36:17 +0000 |
| Subject: | Re: [PATCH] disallow arguments by ref in magic methods | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-31997@lists.php.net to get a copy of this message | ||
Committed.
On 30.08.2007 16:55, Antony Dovgal wrote:
> Hello.
>
> I'd like to commit these two patches (for HEAD and 5_2 appropriately).
> The patches disallow declaring any magic methods as accepting arguments by ref (which makes no
> sense anyway).
>
> Example:
> <?php
> class test {
> function __set(&$name, $val) { }
> }
>
> $t = new test;
> $name = "prop";
> $t->$name = 1;
> ?>
>
> Expected result of this code is:
> Fatal error: Method test::__set() cannot take arguments by reference in %s on line %d
>
>
> The diffs:
> http://dev.daylessday.org/diff/magic_by_ref_5_2.diff
> http://dev.daylessday.org/diff/magic_by_ref_HEAD.diff
>
> If there are no objections, I'm going to commit them later in the evening.
>
--
Wbr,
Antony Dovgal