Because of PHP\'s unlink()
not supporting exceptions natively, I\'m making a wrapper function for it. It should throw a FileNotFoundException
if, w
I've seen php error messages change quite a bit over the years. Maybe, try to detect a change in the last error over a very granular piece of code, and then result to string parsing in a very loose manor.
$lastErr = error_get_last();
unlink($file);
if ($lastErr !== error_get_last()) {
// do something
//maybe string parsing and/or testing with file_exists, is_writable etc...
}