WordPress template file if else issue

Try changing the code for the line with the_field("GPS"); to:

$gps = get_field("GPS");
echo ($gps == '') ? '*' : $gps;

error code: 523