Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26162 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35409 invoked by uid 1010); 22 Oct 2006 22:49:30 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 35393 invoked from network); 22 Oct 2006 22:49:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Oct 2006 22:49:30 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass; domainkeys=good Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.182.185 as permitted sender) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 64.233.182.185 nf-out-0910.google.com Linux 2.4/2.6 Received: from [64.233.182.185] ([64.233.182.185:53148] helo=nf-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 06/1B-54754-875FB354 for ; Sun, 22 Oct 2006 18:49:30 -0400 Received: by nf-out-0910.google.com with SMTP id y25so2441008nfb for ; Sun, 22 Oct 2006 15:49:25 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=cIdp/UotGqwCT+nXndrvQucvmsLMEcBZaJCAvRvg9LBCVTTfmm7/4icF/IGqYunF3ttFkfbmlA+MJ6XA6ZZ2n1fwvc7lfKQSXjJPXvAKiSv7DWbV3GZnFZZXon9c2PP5yOBc09sthQ0TeE/l41WW8KVRsfytP4pje/W3BmYDrFg= Received: by 10.78.204.7 with SMTP id b7mr6426477hug; Sun, 22 Oct 2006 15:49:25 -0700 (PDT) Received: by 10.78.137.6 with HTTP; Sun, 22 Oct 2006 15:49:25 -0700 (PDT) Message-ID: Date: Mon, 23 Oct 2006 00:49:25 +0200 To: "Ilia Alshanetsky" Cc: RQuadling@googlemail.com, "php internals LIST" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <10845a340610221045x2439b02alee7829425c902468@mail.gmail.com> <1B060546-A982-497C-8241-680044CDED15@prohost.org> Subject: Re: [PHP-DEV] Why is mktime(0,0,0,0,0,0) E_STRICT? From: pierre.php@gmail.com (Pierre) 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.