I like this patch. It prevents stupid errors. ZE always passes arguments to magic methods by value so they never may be modified.
Thanks. Dmitry. > -----Original Message----- > From: Antony Dovgal [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 30, 2007 4:56 PM > To: php-dev > Subject: [PHP-DEV] [PATCH] disallow arguments by ref in magic methods > > > 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 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php