All,
What is the signification of the ‘@’ symbol in PHP? For example, what does it mean in this statement:
$sd = (@$argv[1]) ? getdate(strtotime($argv[1])) : getdate();
I understand the ternary operator ‘?’, but I have no idea what the ‘@’ means…
The code is sample code from the (very good!) cs75.net Harvard extension course.
Thanks,
JDelage
The
@symbol suppresses any errors which may be produced in the course of the function (or expression).Error suppression should be avoided if possible as it doesn’t just suppress the error that you are trying to stop, but will also suppress errors that you didn’t predict would ever occur. This will make debugging a nightmare.