Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26167 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56188 invoked by uid 1010); 23 Oct 2006 07:52:06 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 56172 invoked from network); 23 Oct 2006 07:52:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Oct 2006 07:52:06 -0000 Authentication-Results: pb1.pair.com smtp.mail=lsmith@php.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=lsmith@php.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain php.net from 212.112.227.169 cause and error) X-PHP-List-Original-Sender: lsmith@php.net X-Host-Fingerprint: 212.112.227.169 ipx11223.ipxserver.de Linux 2.5 (sometimes 2.4) (4) Received: from [212.112.227.169] ([212.112.227.169:45027] helo=ipx11223.ipxserver.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2F/31-41582-4C37C354 for ; Mon, 23 Oct 2006 03:48:21 -0400 Received: from localhost (localhost [127.0.0.1]) by ipx11223.ipxserver.de (Postfix) with ESMTP id 5901DDF01F7; Mon, 23 Oct 2006 09:48:17 +0200 (CEST) Received: from ipx11223.ipxserver.de ([127.0.0.1]) by localhost (flottensignalgeber [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 15089-02; Mon, 23 Oct 2006 09:48:15 +0200 (CEST) Received: from [127.0.0.1] (i577B7A54.versanet.de [87.123.122.84]) by ipx11223.ipxserver.de (Postfix) with ESMTP id E7FAFDF01F3; Mon, 23 Oct 2006 09:48:14 +0200 (CEST) Message-ID: <453C7372.3070104@php.net> Date: Mon, 23 Oct 2006 09:46:58 +0200 User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: Pierre Cc: Ilia Alshanetsky , RQuadling@googlemail.com, php internals LIST References: <10845a340610221045x2439b02alee7829425c902468@mail.gmail.com> <1B060546-A982-497C-8241-680044CDED15@prohost.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by somedaemon at backendmedia.com Subject: Re: [PHP-DEV] Why is mktime(0,0,0,0,0,0) E_STRICT? From: lsmith@php.net (Lukas Kahwe Smith) Pierre wrote: > On 10/23/06, Pierre wrote: >> Hello, >> >> On 10/23/06, Ilia Alshanetsky wrote: >> > Use of mktime(0) and alike is improper use of the function, more over >> > generally it can be traced to an undesired code behavior. >> >> Which is? mktime(0) is just like mktime(24); if it is not the case, >> there is a bug (it is the case). But I suppose you mean mktime(0,0,0, >> 0,0,0);? >> >> However and for the clarity/sanitiy of this discussion mktime(0,0,0, >> 0,0,0) does not raise any error, mktime(); does. >> >> To solve the only argument in favour of this error message, Derick >> should simply remove the notice and add these three little line before >> the arguments parsing: >> >> if (ZEND_NUM_ARGS() == 0) { >> RETURN_LONG((long)time(NULL)); >> } > > To be exact: > > if (NUM_ARGS()==0 && !gmt) { RETURN_LONG((long)time(NULL)); } > > as gmmktime uses php_mktime as well, but in GMT mode. Yes, I see no point in pushing this responsibility into the userland, especially since its a BC break appearently. regards, Lukas