When using unserialize in php, what is the safest way to handle potential situations where the variable cannot be unserialized.
for example (not that i would ever this, just for examples sake):
$myVar = true;
$result = unserialize($myVar);
This will return false, which is fine. But it also throws a nasty notice.
I have been doing the following:
$result = @unserialize($myVar);
which feels hacky. So what is the best way to unserialize when there is a possibility of false