I am rather a python than a PHP programmer but I don't see why storing first and checking the variable then would make any difference.
Anyways, I changed it. :-)