|
Posted by Thomas Mlynarczyk on 11/17/06 13:27
Also sprach Jerry Stuckle:
> And you can still access the object because its reference still points
> to the object. PHP will destroy the object, but will not alter the
> reference to the object. There is no need to - the reference will be
> destroyed soon, anyway.
So this is a bit like deleting a file on my harddisk - the space it occupied
is just marked as available, but as long as it is not physically overwritten
the file is still there?
> Destructors are meant to clean up the object itself - i.e. for a class
> which access a database you could want to close the database
> connection. It's never a good idea to have a destructor depend on
> the state of another object which itself may be destroyed. The same
> is true when you register a shutdown function - that function should
> not depend on the state of any objects.
In other words: I should always write my scripts to be completely
independent of the shutdown order.
Greetings,
Thomas
Navigation:
[Reply to this message]
|