On Sun, 20 Jul 2003, Zeev Suraski wrote:

> All in all, the destructor functionality is *extremely* fragile - to the 
> degree that in many points in time we thought about removing it (you can 
> look up the CVS archives to see just how many fixes it required so far - 
> plenty).  Preventing access to resources may be something that we'd just 
> have to live with.

What is the point of having destructors then? I did a little quiz on IRC
(yes, I know that that is not our typical userbase) and all of them
mentioned that they wanted to use destructors to: "wrap up files",
"commit a transaction", "do something with an open file", "really make
sure my files are consistent". I am wondering what other use there is
for constructors. Perhaps we should ditch them like namespaces because
we can not come to a good implementation? I don't think that should be
done, as destructors *can* be useful. Besides that I think it's totally
uninituitive that:

$obj = NULL;
?>

works and that the destructor than can access any resource it wants, but 
that:

?>

doesn't work (because the destructor is called from request_shutdown).
I'm pretty sure that there is some way to get this working in a decent 
way... which might perhaps not be the nicest solution.

regards,
Derick

-- 

-------------------------------------------------------------------------
 Derick Rethans                                 http://derickrethans.nl/ 
 JDI Media Solutions                             http://www.jdimedia.nl/
 International PHP Magazine                      http://www.php-mag.net/
-------------------------------------------------------------------------


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

Reply via email to