Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26160 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32220 invoked by uid 1010); 22 Oct 2006 22:27:47 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 32204 invoked from network); 22 Oct 2006 22:27:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Oct 2006 22:27:47 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 204.11.219.139 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 204.11.219.139 lerdorf.com Linux 2.5 (sometimes 2.4) (4) Received: from [204.11.219.139] ([204.11.219.139:52764] helo=lerdorf.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8F/8A-54754-260FB354 for ; Sun, 22 Oct 2006 18:27:47 -0400 Received: from [192.168.200.104] (c-67-169-43-97.hsd1.ca.comcast.net [67.169.43.97]) (authenticated bits=0) by lerdorf.com (8.13.8/8.13.8/Debian-2) with ESMTP id k9MMRfFO027303; Sun, 22 Oct 2006 15:27:41 -0700 Message-ID: <453BF05D.9070006@lerdorf.com> Date: Sun, 22 Oct 2006 15:27:41 -0700 User-Agent: Thunderbird 1.5.0.7 (Macintosh/20060909) MIME-Version: 1.0 To: Ilia Alshanetsky CC: Lukas Kahwe Smith , Derick Rethans , Richard Quadling , php internals LIST References: <10845a340610221045x2439b02alee7829425c902468@mail.gmail.com> <453BE73B.4020300@php.net> <59BCAFC2-C867-47B8-82D3-1BD0887568FE@prohost.org> In-Reply-To: <59BCAFC2-C867-47B8-82D3-1BD0887568FE@prohost.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Why is mktime(0,0,0,0,0,0) E_STRICT? From: rasmus@lerdorf.com (Rasmus Lerdorf) Ilia Alshanetsky wrote: > > On 22-Oct-06, at 5:48 PM, Lukas Kahwe Smith wrote: > >> Derick Rethans wrote: >>> On Sun, 22 Oct 2006, Richard Quadling wrote: >>>> With the recent discussion on E_STRICT and the waste of cpu cycles ... >>>> >>>> Why is mktime(0, 0, 0, 0, 0, 0) generating E_STRICT? >>>> >>>> What is unstrict about this? >>>> >>>> Why is important to use time() instead? >>> It's quicker. >> >> as I just said on IRC: >> i think an e_strict in that place is wrong .. for example the >> parameters could have been user supplied and you simply check that the >> parameters are integers > > That is a weak argument, validation is not just "is the data type > correct or not" it should also perform content checks. Not understanding > of this basic practice is probably why there are so many insecure PHP > applications out-there. Yes, but E_STRICT is not an argument validation error level. Throwing an E_STRICT here is quite wrong unless we have completely redefined E_STRICT to mean just about any sort of error. mktime($a) is perfectly fine at the language level and E_STRICT is supposed to be language-level errors not something that is thrown based on the value of $a. -Rasmus