SyntaxFix
Write A Post
Hire A Developer
Questions
As pointed out by others, it's a (weird) limitation of empty().
For most purproses, doing this is equal as calling empty, but this works:
if ($r->getError() != '')