Re: [PHP-DEV] [PATCH] disallow arguments by ref in magic methods

2007-08-31 Thread Antony Dovgal
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: > class test { > function

Re: [PHP-DEV] [PATCH] disallow arguments by ref in magic methods

2007-08-31 Thread Marcus Boerger
Hello Dmitry, same here. And why not help by forcing to do it in the only correct way? Letting something slip while knowing it will fail anyway just because it doesn kill php is not a good idea - well at least to me. marcus Thursday, August 30, 2007, 3:46:50 PM, you wrote: > I like this patch

Re: [PHP-DEV] [PATCH] disallow arguments by ref in magic methods

2007-08-30 Thread Stanislav Malyshev
The method call doesn't work in this case, it fails with fatal error, just try the example I posted. Ah, missed that part. -- Stanislav Malyshev, Zend Software Architect [EMAIL PROTECTED] http://www.zend.com/ (408)253-8829 MSN: [EMAIL PROTECTED] -- PHP Internals - PHP Runtime Development Ma

Re: [PHP-DEV] [PATCH] disallow arguments by ref in magic methods

2007-08-30 Thread Antony Dovgal
On 30.08.2007 23:27, Stanislav Malyshev wrote: >> Expected result of this code is: >> Fatal error: Method test::__set() cannot take arguments by reference in %s >> on line %d > > I'd make it a warning. As far as I can see, declaring __set with > references doesn't do anything bad, just reference

Re: [PHP-DEV] [PATCH] disallow arguments by ref in magic methods

2007-08-30 Thread Stanislav Malyshev
Expected result of this code is: Fatal error: Method test::__set() cannot take arguments by reference in %s on line %d I'd make it a warning. As far as I can see, declaring __set with references doesn't do anything bad, just reference thing doesn't work (correct me here if I'm wrong). So why

RE: [PHP-DEV] [PATCH] disallow arguments by ref in magic methods

2007-08-30 Thread Dmitry Stogov
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-

Re: [PHP-DEV] [PATCH] disallow arguments by ref in magic methods

2007-08-30 Thread Richard Quadling
On 30/08/2007, Antony Dovgal <[EMAIL PROTECTED]> 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). Why not. Sure, on __set()/__get()/__unset()