Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26168 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59918 invoked by uid 1010); 23 Oct 2006 08:10:39 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 59903 invoked from network); 23 Oct 2006 08:10:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Oct 2006 08:10:39 -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:50158] helo=jdi.jdi-ict.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8C/F1-41582-FF87C354 for ; Mon, 23 Oct 2006 04:10:39 -0400 Received: from localhost (localhost [127.0.0.1]) by jdi.jdi-ict.nl (8.13.7/8.12.11) with ESMTP id k9N8AX1r028169; Mon, 23 Oct 2006 10:10:34 +0200 Date: Mon, 23 Oct 2006 10:09:48 +0200 (CEST) X-X-Sender: derick@localhost To: Lukas Kahwe Smith cc: Pierre , Ilia Alshanetsky , RQuadling@googlemail.com, php internals LIST In-Reply-To: <453C7372.3070104@php.net> Message-ID: References: <10845a340610221045x2439b02alee7829425c902468@mail.gmail.com> <1B060546-A982-497C-8241-680044CDED15@prohost.org> <453C7372.3070104@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, Lukas Kahwe Smith wrote: > 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. There is no BC break: derick@kossu:~$ php-5.2dev -derror_reporting=16383 -r 'echo mktime(), "\n";' Strict standards: mktime(): You should be using the time() function instead in Command line code on line 1 1161590781 derick@kossu:~$ php-4.4dev -derror_reporting=16383 -r 'echo mktime(), "\n";' 1161590801 regards, Derick