Re: [PHP-DEV] $obj = new foo() patch From: Zeev Suraski (zeev <email protected>)
Date: 11/10/00

At 09:51 10-11-00, Andi Gutmans wrote:
>At 02:31 AM 11/10/00 +0100, André Langhorst wrote:
>>>Please check it out. If there are any problems/concerns with this bug it
>>>is best to leave it out for 4.0.4 but it should not harm anyone's scripts.
>>>The following bugs are probably solved now: 6529, 6896, 7454, 7455, 7482
>>>Anyway, please grab a fresh CVS tree and check that your OOP code still
>>>works :)
>>
>>1) It´s broken.
>>
>><?php
>>class foo {
>>
>> function foo() {
>> $this->why_not($this->ret1()); }
>>
>> function ret1() {
>> $obj1->a='test';
>> return $obj1; }
>>
>> function why_not(&$obj) { }
>> }
>>
>>$x = new foo();
>>?>
>
>The patch didn't change this behavior. Up to now you can't send anything
>besides variables by reference. I don't think this has every worked.

It actually always worked, but only appeared to be working. It could (and
almost always did) end up corrupting data structures. In 4.0.4, this is
actively detected, and prevented.

Zeev

--
Zeev Suraski   <zeev <email protected>>
+972-3-6139665, ext 105
http://www.zend.com/

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>