Is this a PHP 'bug' or am I missing something?

il15

New Member
Does anyone know anything about this problem, I have the following code:\[code\]if (strtotime($unlockInfo->UnlockReviewDate) < time()) { echo "<h3>Please review your details and ensure they are accurate and up to date.</h3>"; $verifState = validateUnlockCode($db_conn, $unlockInfo->UnlockCode);} \[/code\]Now as is it seems to work fine but there was a problem that I seemed to be chasing around for ages.Essentially $unlockInfo is an object returned from a mySql query which as you can probably see is evaluated against the current time. Now the validateUnlockCode function has the ability under specific circumstances to modify the database and therefore the $unlockInfo object.Nothing, however, should be modified until after the if statement is evaluated. but when I miss the space out from the if statement, ie.\[code\]if(strto....\[/code\]this seems to cause the $verifState to be set before the if is evaluated therefore calling the validate function and modifying the database premeturely.Is this normal? is that supposed to happen? Sorry, I'm a bit confused on this one.
 
Back
Top