Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106798 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 99742 invoked from network); 29 Aug 2019 16:50:24 -0000 Received: from unknown (HELO tbjjbihbhebb.turbo-smtp.net) (199.187.174.11) by pb1.pair.com with SMTP; 29 Aug 2019 16:50:24 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=php.net; s=turbo-smtp; x=1567693369; h=DomainKey-Signature:Received: Received:MIME-Version:References:In-Reply-To:From:Date: Message-ID:Subject:To:Cc:Content-Type; bh=DVg0OVsmnyUfNMCVR0ykxz qe6NS1pdtr/NMsjCYp9n4=; b=RDox1LI8tXMR1iWbv8bdQxhzsg5OHBbzxObLWO LelEHTC5whiv+Hx+BxK6srV8N6vftUN3cBvnT2WfVWW7zWKPy/HCzMPuBTLVPUrS nuPkolAOWOhTxBbYGphIPceKpdl0Pw4QSR57CTH3jo+Hu+LhDXjmyaxvAuVMtOam tAfNs= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=turbo-smtp; d=php.net; h=Received:Received:X-TurboSMTP-Tracking:X-Gm-Message-State:X-Google-Smtp-Source:X-Received:MIME-Version:References:In-Reply-To:From:Date:X-Gmail-Original-Message-Id:Message-ID:Subject:To:Cc:Content-Type; b=Wshc9Uxw2v2hYfRtdAylHFnnqkTBVmvb6HAtLLWykhImIWSFeSLRA0HiK5Pkc5 IMBPcetckLL4eumpsiLPtpc7wQgWvOTHp2ypMQ68LHC6UajTyuAVaeo4vbM5dH48 K2/x27c5YJ0nsih6sq0hqS0/pXVYduKKuoxAWpJucIlM4=; Received: (qmail 12603 invoked from network); 29 Aug 2019 14:22:49 -0000 Received: X-TurboSMTP-Tracking: 5247646714 X-Gm-Message-State: APjAAAVNwpyEp+Lde/u9UuN70CfZIjAVELzyyVMWEDHMiWFVu7baPv+o +JevnG+lMlsVMLAhh2Xc0uD3yidEZtq1wciseWk= X-Google-Smtp-Source: APXvYqzPU9rRdZs352FyJFzQ/sj7d/0YOSXHUyY2VZUC1W/O8dXfCpSzMFWPj2e+4wN+KUotKJnyq0uMCnF1+2hGlg4= X-Received: by 2002:a37:2c41:: with SMTP id s62mr9807762qkh.415.1567088568770; Thu, 29 Aug 2019 07:22:48 -0700 (PDT) MIME-Version: 1.0 References: <33b4068a-3b32-4904-a033-4ff3f28e1161@aegir.sexy> <1EDD1FE6-9AB8-4CDF-8EE4-416C18390725@gmail.com> In-Reply-To: Date: Thu, 29 Aug 2019 17:22:33 +0300 X-Gmail-Original-Message-Id: Message-ID: To: Aegir Leet Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000792ba30591423d6c" Subject: Re: [PHP-DEV] [RFC] Reclassifying engine warnings From: zeev@php.net (Zeev Suraski) --000000000000792ba30591423d6c Content-Type: text/plain; charset="UTF-8" On Thu, Aug 29, 2019 at 4:02 PM Aegir Leet via internals < internals@lists.php.net> wrote: > I know what the manual says about notices. But I don't agree with > interpreting "could happen in the normal course of running a script" as > "it's perfectly fine if this part of your code triggers a notice > consistently and every time it goes down this particular code path". > Rather, I've always interpreted this as "under certain, rare, unforeseen > circumstances, your code could generate a notice here, probably because of > something that is outside of your control". > > That's how I've always treated them at least. > And that's entirely within your right to do so - but what the manual says is accurate. Calling me delusional in my interpretation of it is somewhat awkward (to put it mildly), I have a pretty good idea of why we added the different error levels - I wrote much of it myself. The whole point of having notices as something that's separate from warnings is that they have different semantics, and that semantics is captured very accurately in the manual. They are used to mark issues which may be problems, but may also be perfectly fine (unlike warnings, which generally speaking mean that something bad happened, but not bad enough to halt execution). Notices were meant to help you implement a more strict style of coding, and they may help you catch certain types of bugs, but you can have perfectly working, bug-free code that generates notices. Regardless of the exact semantics, don't you think a program that generates > a constant stream of notices is a bit strange? That sounds like something > everyone would naturally want to avoid. You don't drive your car with the > check engine light permanently on and say "this is fine", right? Except you can purposely turn off this 'check engine' light, never to see it again if you choose to. And that it's really not at all similar to 'check engine', but a lot closer to 'check cleaning fluid', or even 'clean windshield' (if cars had a dashboard light for that). Even that is not a good analogy - as folks often actually purposely write code that generates notices (which would be purposely hidden, either by error_reporting setting or using @) that is 100% bug-free and working as intended. So no, there's nothing strange about it if you buy into that approach. If you don't (and I know you don't) - that's absolutely fine - it's up to you. Zeev --000000000000792ba30591423d6c--