Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111006 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 67925 invoked from network); 14 Jul 2020 21:50:57 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 14 Jul 2020 21:50:57 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2BC761804D2 for ; Tue, 14 Jul 2020 13:43:29 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 14 Jul 2020 13:43:28 -0700 (PDT) Received: by mail-lj1-f174.google.com with SMTP id h19so27269ljg.13 for ; Tue, 14 Jul 2020 13:43:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=V1EdUnv4mXv7cdfWmjGZcEaZ+WGOMiQca3DMhlDLhJQ=; b=VoUTo5Xs42PBwlnnhAvQ+qCwc1npjsFMm+UU4VT1W0UL3LiI8upgcT+9sDWFUc42nZ BtHjCO6oRRRTWcQDi3oqW7glysNui2bqkcPmfN0B224tVEmSwSompfLME3t6xp41h5N5 Vmk+rSIexHFCfsevIO1aUwIJnI/ZJ5J2AI6CmHbCqrpYDP3t4H6yv1tAkyKc/5JapPB8 lu4srV1y1AVjPtGXptT314d957/x/NtokQuuzbODW+I2gnq0JSXNgJQ609EzBEgt6xTm rwFwOOvpleeeaqerx2KEzA46oCvlZ7pbS8TUpSJZvr1iIbnYX3TUxqI456XyrEk3a9mH p3Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=V1EdUnv4mXv7cdfWmjGZcEaZ+WGOMiQca3DMhlDLhJQ=; b=tguP+yoLobnflBMSjdwDzh30dMpPJBKkb2bkfAHKunVQl68jeVRz6Lt73H9bHrpKOJ R/RL1do45Nb1fdSWM0t/4cSTfCQE0ieRPTc195MwM2hX7j/6Qg5Kgvma+R1g+xCn85AY T5q2GsWZ2OKiI/2zYwmcpeVtV0Yz9+9F/V0WBqUHV5EGYyP18aCd26uAkG8Wkpt1h8Qe o0bW86e7Ad20iKy+xCg/Mu/RZ8oH74eq6qrCpUFWW7fHFoB7eVVxi7+rX6o8thVRGGfe XxkR6qDX5vrILlSO0DbELI5CdFIZCTPDRfS2eR6bHL6ZjoT9nuo1Dzw+vUDKJQ0IQ4Vc 9UCw== X-Gm-Message-State: AOAM53317nMmO3xAaDx5Ee/XRbHrsg9q/5Ou32/SsN13TG75Uoji4inC z1WtxcCwWX2xxJpJJdzb5NG+PzLt1X4WS8Tml5U= X-Google-Smtp-Source: ABdhPJy6+5fYsZensFfJHkrD8aDwY8VBNzI6m9hSwPMghVeRe2PcvqwUXgyepFZbrGFujRXqDk4GsXzjI3HJMo4VWGU= X-Received: by 2002:a2e:8047:: with SMTP id p7mr3238087ljg.414.1594759407063; Tue, 14 Jul 2020 13:43:27 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 14 Jul 2020 17:43:15 -0300 Message-ID: To: Levi Morrison Cc: Levi Morrison , internals Content-Type: multipart/alternative; boundary="000000000000f5d71f05aa6cdb1c" Subject: Re: [PHP-DEV] Changing default assertion mode to throw exceptions From: marcio.web2@gmail.com (Marcio Almada) --000000000000f5d71f05aa6cdb1c Content-Type: text/plain; charset="UTF-8" Hi! On Mon, Jul 13, 2020 at 11:52 AM Marcio Almada > wrote: > > > I'd like to change the default mode of assertion failures to throw. > > > The current default is to warn. In my opinion this is a bad strategy: > > > the engine asserted that something that is expected to be true is not, > > > so executing further is a bad idea. This leaves throwing or bailing > > > out. I think throwing an exception is better than bailing out, so > > > that's what I propose. > > > > Couldn't agree more, but I always assumed this BC break could be > > too big before. Did you make any research on the impact already? > > > > Otherwise +1 > > Nikita put together a search of top packagist repositories to look for > assert: > https://gist.github.com/nikic/8311ee63c72573d514217456bf2df552 > > We can't generally know what their ini settings are, though. > > In my opinion this change is worth any backwards compatibility break > as we are choosing the worst setting except for ignoring them > altogether, and can be changed back to the previous value using an > existing ini setting; we just need to put a note in the migrating > guide. > I took a look at the top ones + random picks, most are converting warnings to exceptions at least during tests. Still a +1 from me. --000000000000f5d71f05aa6cdb1c--