If they are unix timestamps, I don't get why you would set them and then get them to compare them then. Just compare them from the get go?
function checker($timestamp1, $timestamp2){
if (abs($timestamp1 - $timestamp2) <= 5*60 ) { return 1; } else { return 0; }
}