What's the best in terms of speed and performance? To call the function each time you need the value (e.g mysql_num_rows, time) or to copy the return value to a local variable and use that instead.
Example: Let's say that I call the time() function ten times to get the current time, would it be faster to use a local variable those ten times instead?