You are here: Re: What performs better, theoreticaly? « PHP Programming Language « IT news, forums, messages
Re: What performs better, theoreticaly?

Posted by Oliver Grδtz on 04/23/07 15:55

Rolf Mander schrieb:
> What performs better, theoreticaly?
> This
> <?
> echo date("d",time());
> echo date("m",time());
> echo date("Y",time());
> ?>
> Or that?
> <?
> $time = time();
> echo date("d",$time);
> echo date("m",$time);
> echo date("Y",$time);
> ?>

Like others already told you: The first version produces a race
condition when being run over a date change.

And perhaps you might consider using $_SERVER['REQUEST_TIME'] which
contains the timestamp of the begin of the request...

OLLi

--
Bree: "Oh, hello."
Bartender: "Hi."
Bree: "Hi. Um, I need some advice from a professional. I'd like to get
stinking drunk. Do you have anything that can accomplish that in a hurry?"
[DH 218]

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация