<?php
class Test {
public function foo() {
echo "Foo!";
die();
}
public function __destruct() {
header('location: http://google.com');
}
}
$Test = new Test;
$Test->foo();
I have a class which simply assign's various Session variables then pings the user back to their previous script. I figured that it would be simpler to have a single redirect on the destruct instead of 10 lines saying the same thing.
I later found a bug in my script and found out that it was nigh on unkillable. For future reference, is there anyway to kill this script or will it always redirect?
To clarify, the script always redirects even with die(), exit in the foo function.