> Well, some time ago I wrote a small functions, that does exactly the same: > > PHP_FUNCTION(unregister_class) > { *snip*
Barring some stylectic differences and a check to make sure it's not an internal class, that's precisely what I gave sean in shiva_destroy_class()....
But just to be clear, I don't think it's a good idea, and I'll wager dollars to doughnuts that it destablizes the active request if not the entire engine.
From the technical perspective, it's actually easy to implement in a rock-solid manner. Don't kill the class completely but just clean any functions/properties inside of it, and mark it as dead. Then patch the class declaration begin code to check for this flag, and reuse the class structure instead of complaining about reregistering a class. There might be some more cleanup necessary in PHP 5, but if any, it shouldn't be too complicated.
But I agree with you that it's a bad idea :)
Zeev
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php