Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26191 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6136 invoked by uid 1010); 23 Oct 2006 17:43:27 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 6121 invoked from network); 23 Oct 2006 17:43:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Oct 2006 17:43:27 -0000 Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain php.net from 82.94.239.5 cause and error) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.94.239.5 jdi.jdi-ict.nl Linux 2.5 (sometimes 2.4) (4) Received: from [82.94.239.5] ([82.94.239.5:46179] helo=jdi.jdi-ict.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E2/B9-39788-C3FFC354 for ; Mon, 23 Oct 2006 13:43:25 -0400 Received: from localhost (localhost [127.0.0.1]) by jdi.jdi-ict.nl (8.13.7/8.12.11) with ESMTP id k9NHhJLk021025; Mon, 23 Oct 2006 19:43:19 +0200 Date: Mon, 23 Oct 2006 19:42:31 +0200 (CEST) X-X-Sender: derick@localhost To: Pierre cc: Lukas Kahwe Smith , Ilia Alshanetsky , RQuadling@googlemail.com, php internals LIST In-Reply-To: Message-ID: References: <10845a340610221045x2439b02alee7829425c902468@mail.gmail.com> <1B060546-A982-497C-8241-680044CDED15@prohost.org> <453C7372.3070104@php.net> <453C7A0A.8050905@php.net> X-Face: "L'&?Ah3MYF@FB4hU'XhNhLB]222(Lbr2Y@F:GE[OO;"F5p>qtFBl|yVVA&D{A(g3[C}mG:199P+5C'v.M/u@Z\![0b:Mv.[l6[uWl' MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] Why is mktime(0,0,0,0,0,0) E_STRICT? From: derick@php.net (Derick Rethans) On Mon, 23 Oct 2006, Pierre wrote: > Hello, > > On 10/23/06, Derick Rethans 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