Hello Florian,

there is no problem in calling resource destructors/terminators in your
destructors. You simply cannot output text to your pages from them. If
this is not true then we need to fix it. For example if an object of
yours holds a database connection and your destructor executes some
SQL code this must work. Open a bug report if necessary.

regards
marcus

Monday, June 28, 2004, 1:25:15 PM, you wrote:

> Marcus Boerger wrote:
>> Hello Gareth,
>> 
>> __destruct will get executed during request shutdown after the
>> communication has been shutdown. The only way to be able to write
>> from within __destruct is to deinitialize it at the end of the
>> script and therefore before the request is being finished. To
>> do so you can use 'unset($object);'
>> 

> But then again why call destruct on the objects after the external
> modules
> have been shut down? This heavily confuses people and I see no apparent
> reason
> to do so (then again I'm not deep into the PHP internal structure)?
> I find it highly attractive to be able to save a "session"-object via my
> destructor / close DB connections - you name it.

> zend_objects_store_call_destructors(&EG(objects_store) TSRMLS_CC);
> before php_call_shutdown_functions(); etc.

> Can somebody enlighten me?

> ./regards

> Florian




-- 
Best regards,
 Marcus                            mailto:[EMAIL PROTECTED]

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

Reply via email to