Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107055 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 40283 invoked from network); 13 Sep 2019 10:52:56 -0000 Received: from unknown (HELO localhost.localdomain) (76.75.200.58) by pb1.pair.com with SMTP; 13 Sep 2019 10:52:56 -0000 To: internals@lists.php.net References: <076701d56978$86020910$92061b30$@php.net> <078e01d5697c$5512bc10$ff383430$@php.net> <31BD63BC-ACE0-4478-B241-E698D2D6F59C@newclarity.net> <77CA024D-3141-4707-8280-81CA78282AFA@newclarity.net> Date: Fri, 13 Sep 2019 09:28:59 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Posted-By: 94.4.34.143 Subject: Re: [PHP-DEV] Changing fundamental language behaviors From: markyr@gmail.com (Mark Randall) Message-ID: On 13/09/2019 09:10, Christian Schneider wrote: > Is it really worth it? It's absolutely worth it. Stopping execution flow at erroneous or ambiguous statements is an essential part of secure, reliable programming. A notice or warning offers no protection at all. Unless you've taken some very specific steps, your program will continue operating as if they never happened, even if that notice or warning was clearly a high probability of being a bug. > And if you really think so, could we make it opt-in? People should not have to opt in to common sense defaults. If I sell you a car, you shouldn't have to opt in to having the bolts on your tyres fastened on tight enough that the wheels don't fall off the moment you hit motorway speed. > Or at least globally opt-out-able? Let's not. Never again should an option like enable_short_tags exist. If you want a per-file opt out, the notion of declare(sloppy=1); Has already been jokingly proposed, and I would personally have no problem with it if people want to opt-in to less reliable enforcement... but once again, I stress that the defaults should always be best-practices. -- Mark Randall