If I have instantiated an object, is there a possible way for it to trigger a method before php shutsdown?
example
class foo{
public function sayBye(){
echo 'bye';
}
}
$obj = new foo();
$obj2 = new foo();
die();
Is there a way I could automatically trigger the sayBye function? (in otherwords that code would output “byebye”)
What about putting a call to
sayBye()in the destructor?http://php.net/manual/en/language.oop5.decon.php