On Sat, June 30, 2007 9:55 am, Jakob Buchgraber wrote: > Okay, I can now reproduce the problem. Here is the code: > <?php > class Foo { > public function __destruct() { > throw new Exception(); > } > } > > $a = new Foo(); > ?> > > I couldn't reproduce it before as I didn't assign the instance of Foo > to > a variable, however Christian Hoffmann pointed me out that I need to > do > this in order to get the desired error.
The only solution I know of is: Don't do that. :-) Or, accept the fact that your code running in the destructor is happening outside the realm of time and space as far as PHP is concerned. Bascially, anything that goes wrong before PHP starts interpreting your script (i.e., custom file upload, custom session, custom php.ini settings extension) and anything that happens after PHP has finished the last line of your code (session_close function, desctrutors, etc) is going to have a not-so-informative message about which PHP file / line caused the problem, or a lack of a stack or whatever, because PHP is not in a stable state of existence at that point. Deal with it, or don't do what you're doing are the only real options... -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php