Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62027 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25308 invoked from network); 3 Aug 2012 23:37:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Aug 2012 23:37:27 -0000 Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.42 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.160.42 mail-pb0-f42.google.com Received: from [209.85.160.42] ([209.85.160.42:61506] helo=mail-pb0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F4/16-23476-6B06C105 for ; Fri, 03 Aug 2012 19:37:27 -0400 Received: by pbbrp12 with SMTP id rp12so2296876pbb.29 for ; Fri, 03 Aug 2012 16:37:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=dlGYaNRv9XbC2wacE7A79ANSCD+DfBvQCIb49X6tpd0=; b=gTsmKep9bcm20aTTlOnVMANo9MWOpW+IR8/irkyHw6ZNMC6X/myC4O1YujvPJ55pv2 n5mW67d39/p4rdAQ3kGrIHIoE6GpFWUccUebFhKVGt1NPrekBHsUJgtbDYAWoZThwG7i MMAeI//7z8VeOeNFJOKNqydWNobp+Qpzy1GeB5AymDGyp0YXhdMpA8umjrqDihhDv4Iu vKUqoBjtbeiwwzwjbm2CZhdQLn1zviYtUHotrL1QPBQKCLyxwJB4QomLyXf7p40xcQvg J6TAN9xujSHIWlY68tMTjHaDeD7epFTyKbRVOF3KNuswxYjw56LtB5+cHCTFKc4XBsjk AN+Q== MIME-Version: 1.0 Received: by 10.66.81.232 with SMTP id d8mr1982727pay.66.1344037043737; Fri, 03 Aug 2012 16:37:23 -0700 (PDT) Received: by 10.68.28.41 with HTTP; Fri, 3 Aug 2012 16:37:23 -0700 (PDT) In-Reply-To: <6214E40C106D49398CC920D8587815B4@pc> References: <6214E40C106D49398CC920D8587815B4@pc> Date: Sat, 4 Aug 2012 01:37:23 +0200 Message-ID: To: Stan Vass Cc: Nikita Popov , PHP Internals , Andrew Faulds , Etienne Kneuss Content-Type: multipart/alternative; boundary=f46d042f972c8e960404c66502d8 Subject: Re: [PHP-DEV] Error handling brainstorming From: tyra3l@gmail.com (Ferenc Kovacs) --f46d042f972c8e960404c66502d8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sat, Aug 4, 2012 at 1:16 AM, Stan Vass wrote: > When I said I'd like to see E_STRICT be fatal/exceptions it wasn't a typo= . > My choice isn't based as much on what the current error severity is, or > what the error severity is supposed to represent in general, because I've > found in PHP often the error severity has no connection with the error > that's being reported. So I decided this by observing the real-world erro= rs > that use a certain severity. > > Many warnings and all E_STRICT errors clearly point to bugs in the code, > wrong method signatures, non-existing variables and constants being used, > which can easily do actual data damage if the script keeps running in > undefined state (even if the engine is just fine with it). > are you sure about that? E_STRICT is more about code that works but relying on some quirk or side-effect or simply does a stupid thing. see http://www.mail-archive.com/internals@lists.php.net/msg24665.html about the original proposal and the discussion and you can see the list of E_STRICT errors in the 5.4 branch here: http://lxr.php.net/search?q=3DE_STRICT&defs=3D&refs=3D&path=3D%28*c%29+OR+%= 28*h%29&hist=3D&project=3DPHP_5_4 stuff like using non-existing variables and constants are E_NOTICE, method signature mismatches are either fatal errors or warnings AFAIR. > > PHP should not split the language semantic into loose, less loose and > strict, there should be just one set of semantics: the PHP semantics, and > when code does something that doesn't fit, it shouldn't be an ignorable > warning. > it is the opposite, we allowed sloppy code in the past, and introduced E_STRICT to allow the pedantic people to find and fix the quirks and E_DEPRECATED for finding and migrating the code which will go away. from all of the errors levels only E_DEPRECATED and E_STRICT is what means that atm your code works as intended. but for E_DEPRECATED it will not work in the future, and for E_STRICT it is either does it's job sub optimally or the requested operation is just stupid (but doable). at least this is the theory, if you know something with doesn't in line with this, we could talk about it. :) > > I've found this speeds up the development process, keeps bug count down > and protects the site/app's data in case of bugs. I agree that developing with E_ALL (including E_STRICT) is a good developer mentality. But I would find it too intrusive to start forcing everybody with the next version to either fix every E_STRICT in their code, and even more weird if we do that but still allow them to write code with full of E_WARNING and E_NOTICE and get away with that. --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --f46d042f972c8e960404c66502d8--