Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111125 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 30499 invoked from network); 22 Jul 2020 16:11:07 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Jul 2020 16:11:07 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E62641804C8 for ; Wed, 22 Jul 2020 08:05:35 -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-il1-f178.google.com (mail-il1-f178.google.com [209.85.166.178]) (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:05:35 -0700 (PDT) Received: by mail-il1-f178.google.com with SMTP id a11so1589568ilk.0 for ; Wed, 22 Jul 2020 08:05:35 -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=Uu5wDT4gTBB58I85VLlRaZsap+zjAXDmfh5sguRW9xk=; b=oTjma35iHYzvmNrdoD+3T1pV3rd0zUT6DdvVF5QJqkCs5EAOSZA4wsPR9OdXrZ2q1b KtuczcxlvzF8PUzQ88dNqNz025tOUk0Wm09QZezVdDpBvNWz0KabU7Wgu2TScUHS1L3V xXGL2minj0+vTm1GOHtytlQucIgo4YmDfq9oKPd+Apkfb49ofuobDQsoqsGvGZIO1uUU dw7CjM309e0hQNjIgyOJVMDF+UBE5y5zmlurcZ1p0y8ah2sjgLKA3FpVGYLYgmAZ3QMI Su8PBO4znsnfX4k4OVRd0Vf6haNiuHSJ4ROTZd2Gc/MY7piAaKlMx6ibNusEfbvy5nM+ Rjsw== 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=Uu5wDT4gTBB58I85VLlRaZsap+zjAXDmfh5sguRW9xk=; b=K4MOjnpsAMYA45quakxyLIHtIhVq8Fy3sbzPUesLiyznKKehkw6O4ML4WF8RWLIiKp XGbX37RftI9tWWUrEiucSVpOt/taH0gvEJoEcD/p6iekPzXxMEhjwVoMB2KJ7MQ/e8Zz rdjlUjq/2N3g8HVoPraEcL3iwMRbiX4EjASwcgcD3GoNv8kX+eVnq+ChL9nvVE9lr5r0 /qVosRyABbSlGXKGVcuvocc97rkXX3SEOIpek8iY5T2WVNp1GiEFCkWaLIQyT231xund NliFqdPkKk1ZEY+Yl1KSVjSHUaXFxjQmMhRFz75xvwv1db01gUA8V/ll5pJSP8phlQdb y1pg== X-Gm-Message-State: AOAM531FfpTFKLoTZzttTi0l6WR+8Z2cqB0KcdJLfPcrdr3YEnMvrbuM kKsIhHM0uFjGZ0BmYwYd24AMX0d/iU7sq3H/3fo= X-Google-Smtp-Source: ABdhPJw6OokJSnXREEReb443k750IZWLcg0CkJZQ2Rd1UVeyoTKrtFhhf6l5xz4+H6Rs9ynqOl21Lxcr2g68ioNfokg= X-Received: by 2002:a92:5e17:: with SMTP id s23mr288161ilb.149.1595430332907; Wed, 22 Jul 2020 08:05:32 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 22 Jul 2020 17:05:16 +0200 Message-ID: To: Levi Morrison Cc: internals Content-Type: multipart/alternative; boundary="00000000000041c68505ab0912ec" Subject: Re: [PHP-DEV] Changing default assertion mode to throw exceptions From: carusogabriel34@gmail.com (Gabriel Caruso) --00000000000041c68505ab0912ec Content-Type: text/plain; charset="UTF-8" On Mon, 13 Jul 2020 at 19:37, Levi Morrison wrote: > 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. > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php Hello Levi +1 on this one, I use assertions on my local development, and we also have that on `doctrine/coding-standard` ( https://github.com/doctrine/coding-standard/pull/47). I think throwing an exception is indeed a better way to make the most out of it. --00000000000041c68505ab0912ec--