Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111127 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 38148 invoked from network); 22 Jul 2020 16:59:06 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Jul 2020 16:59:06 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4AF79180533 for ; Wed, 22 Jul 2020 08:53:33 -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=0.5 required=5.0 tests=BAYES_20, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (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 ; Wed, 22 Jul 2020 08:53:32 -0700 (PDT) Received: by mail-pl1-f181.google.com with SMTP id b9so1198821plx.6 for ; Wed, 22 Jul 2020 08:53:32 -0700 (PDT) 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=cM9ArX8VajoNKY93w72vlS6dfOJU/VaQZlHfCHsUIsE=; b=tJCcc3uDDmNXbQJm4QzBbGSLY4kW4FgmH9lBWHDwockJjwPWUET/vzqW4KNaP/OXEA BHknsAOayGhn7UzMgOaGhuX12cuHuKOkpCih5G2pKEuB9FTOWcD1oW2OBH2oTNlh+Kxr bg0Md5cZ9WQzJsNjP+HUkFUuYumvl0PpHTPnphYUD+OAV/VvKt7YD2+RFP7+HZPClJId lv+wAkLvId2ae3FEjoT1OXxdnEDu0vXrNqN29ONL8A6PoQTbL4lYK+cXxNb7ByGjH+qB KDR+YVovPHlmwXA3heLfQNiTFWO7wvFHUwPquJV1lsytJc1IiWqBGjmMa3uNMSilTyVa QM1Q== X-Gm-Message-State: AOAM531t07eyAYLUGiFND+3/23tZybcNPciTmtsCipPjtgq6c8sjwP8/ 5bxIecZMkJFB80FxOifAUfzOKq6c2zDXYF2sR6Tr+w== X-Google-Smtp-Source: ABdhPJxB/3xPcKCD8Cg8TRXCsUNLCxX+8754urUdMwpchGORPRsWi4O51vml0h2cWd1r6HDIr8kg3XANFHmoiCt/vtY= X-Received: by 2002:a17:90a:c592:: with SMTP id l18mr46814pjt.119.1595433211753; Wed, 22 Jul 2020 08:53:31 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 22 Jul 2020 18:53:26 +0300 Message-ID: To: Levi Morrison Cc: internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Changing default assertion mode to throw exceptions From: kalle@php.net (Kalle Sommer Nielsen) Hi Den man. 13. jul. 2020 kl. 20.37 skrev Levi Morrison : > > Hello everyone, > > 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. +1 on this. I was recently surprised why this wasn't the default either -- regards, Kalle Sommer Nielsen kalle@php.net