It might depend on the setting for ignore_user_abort, if that's off, and
the user aborts
the request I'm not sure if/how the destructors are called.
Good point. I tested this with the following script:
<?php
if (ini_get ("ignore_user_abort")) {
die ("ignore_user_abort must be disabled");
}
class Foo {
public function __destruct () {
file_put_contents ("/tmp/isRun", "ok");
}
}
$a = new Foo();
sleep (5);
?>
The destructor definitely gets called as the file exists regardless if I
abort the request or not.
jakob
--
Sun Certified Programmer for the Java 2 Platform, Standard Edition 5.0
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com
Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php