Which is faster?
When loading user info into a mysql database, I notice that both of these php scripts have the same end-result.
method #1
$h["address"] = getenv(REMOTE_ADDR);
$h["agent"] = getenv(HTTP_USER_AGENT);
$h["referer"] = getenv(HTTP_REFERER);
-and-
method #2
$h["address"] = $REMOTE_ADDR;
$h["agent"] = $HTTP_USER_AGENT;
$h["referer"] = $HTTP_REFERER;
My question is: Would "method #2" be slightly faster for the server? The first method looks like it uses "functions." Wouldn't the server have to look up what the function means, then do the function? Whereas the second one just pops that data right into the database?
What do you think?