> Is temporary-object behaviour supposed to happen
> in cases like $obj->another->func(), or is this
> an unintended side-effect of something else?

no side effect, happens each time you dereference more than one member.

$obj->foo->bar->func();

will therefore create two temp objects.

>
> Does PHP usually create temp-objects when referencing
> $obj->another, or is that behaviour only part of
> the COM subsystem?

it is the case for non-native php objects. the php com subsystem is only a wrapper 
that makes a com object behave like a
regular php object.
so if you do something like

$foo->bar->func();

we first have to create a wrapper for 'bar' so that it behaves like a php object and 
we can call func() on it.
doing

$baz = $foo->bar;
$baz->func();

does not change the fact that a wrapper for 'bar' is created, but in this case the 
wrapper is not temporary but it is
assigned to '$baz'. due to a bug the temporary objects were not released but the named 
ones were released by phps
garbage collector.
this is fixed now !!

> Sorry for asking questions that are probably obvious,
> but i'm not really too familiar with the details
> of PHP's object handling.

noprob.

regards,
harald



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to