O ciddi bir hata değil, o satırdan hemen öncesine şunu eklediğinizde ortadan kalkar:
if(!isset($output))
{
	$output='';
}