und dann im try-block
$php_errormsg
abfragen, wenn was drinsteht, Exception werfen. Getestet, geht einwandfrei ;)
Oder einfach error_get_last() fragen:
if(error_get_last()){
$eo = (object)error_get_last();
throw new Exception(sprintf("%s at %s, line %u", $eo->message, $eo->file, $eo->line));
}
;)