use exceptions instead of $trigger_errors