Question about function returns
Posted: Wed Jul 18, 2007 8:40 pm
If I have the following code:
Does the dbClose method of myObject get fired before myFunction sends control back to the calling routine? Or does return TRUE; happen after the entire function is handled?
Advice is appreciated!
-- Tom
Code: Select all
function myFunction() {
$myDbObject = new DbObject;
$myDbObject->dbOpen();
$records = $myDbOject->getRecords();
if (mysql_num_rows($records) > 0) {
echo ("success!");
return TRUE;
}
$myDbObject->dbClose();
}Advice is appreciated!
-- Tom