If empty text is encrypted, the gnupg_decrypt() function will return a boolean FALSE so if you do a strict comparison (===, !==) to track a failure it will trigger you a failure.
For failures use Exceptions:
<?php
$gpg = new gnupg();
$gpg->seterrormode(gnupg::ERROR_EXCEPTION);
/*
.......further code.......
*/
try {
$string = $gpg->decrypt($stringToDecrypt);
} catch (Exception $e) {
// do the Error processing
}
?>