Re: Why is mktime(0,0,0,0,0,0) E_STRICT?

From: Date: Mon, 23 Oct 2006 17:42:31 +0000
Subject: Re: Why is mktime(0,0,0,0,0,0) E_STRICT?
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to internals+get-26191@lists.php.net to get a copy of this message
On Mon, 23 Oct 2006, Pierre wrote: > Hello, > > On 10/23/06, Derick Rethans <derick@php.net> wrote: > > On Mon, 23 Oct 2006, Lukas Kahwe Smith wrote: > > > > > > > Yes, I see no point in pushing this responsibility into the userland, > > > > > especially since its a BC break appearently. > > > > > > > > There is no BC break: > > > > > > I meant, there would be a BC break if this feature gets dropped, which is > > > the > > > point of the message, right? > > > > Yeah, but there is no point in calling mktime() without arguments as you > > can use time() doing the same. It's just a friendly hint that you're > > wasting CPU cycles. It's an E_STRICT message for ****s sake. > > How can I have "gmmktime();" (which also uses php_mktime) with time()? gmmktime() without parameters is broken in PHP 4 anyway. If you don't give it arguments than it should default to the current date and hour (in GMT for gmmktime() and in localtime for mktime()). In both places this should result in the same timestamp, which gmmktime() doesn't even do on PHP 4: derick@kossu:~$ php-4.4dev -r 'echo mktime(), "\n", gmmktime(), "\n", time(), "\n";' 1161625133 1161632333 1161625133 (it substracts an hour if you are in DST without any valid reason). PHP 5.1+ handles this correctly: derick@kossu:~$ php -r 'echo mktime(), "\n", gmmktime(), "\n", time(), "\n";' 1161625256 1161625256 1161625256 regards, Derick -- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org

« previous php.internals (#26191) next »