On 20/03/11 14:30, Stas Malyshev wrote:
> Hi!
>
>> I guess I'm suffering from some tl;dr here. Here's the short version:
>> please apply the attached patch to the 5.3 branch. It removes some
>> code which is broken and unnecessary.
>
> I'm not sure it's a good idea. That code is there for a reason,
> specifically: http://svn.php.net/viewvc?view=revision&revision=216213
> Did you check that this test still works when you apply your patch?

It doesn't work, because my patch is just a revert.

That bug (36759) doesn't seem to have anything to do with global
variables, so deleting global variables seems like an odd response to it.

r216213 fixes that one test case, but it seems like the actual
complaint there is that objects stored in member variables are
destroyed before their parent objects. r216213 fixes this by assuming
that all parent objects will be in the global symbol table. It deletes
global symbol table entries, so that only objects which are referred
to from somewhere else will survive until the
zend_objects_store_call_destructors().

If you take Dmitry's test case and replace this:

$y = new Bar();
$x = new Foo($y);

with this:

function foo() {
    static $x, $y;
    $y = new Bar();
    $x = new Foo($y);
}
foo();

then the bug is still seen. Or indeed, because of the logic error I've
discussed, this also shows an incorrect destructor order:

$y = new Bar();
$x = new Foo($y);
$z = $x;

Can you reopen bug 36759 please?

-- Tim Starling

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to