This can be quite tricky. Some functions may have side effects so that remembering return value doesn't make sense if next actions mutates the state
if (file_exists('foo')) {
unlink('foo');
if (file_exists('foo')) {
echo "File still exists although it was deleted";
}
}