Re: Excel not closing after using it via COM
| From: | Harald Radi | Date: | Sat, 27 Apr 2002 10:47:13 +0000 |
| Subject: | Re: Excel not closing after using it via COM | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-13355@lists.php.net to get a copy of this message | ||
> 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