Using exceptions instead of trigger_error calls.