Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111003 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 24294 invoked from network); 14 Jul 2020 17:26:59 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 14 Jul 2020 17:26:59 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 957F618054D for ; Tue, 14 Jul 2020 09:19:27 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11olkn2035.outbound.protection.outlook.com [40.92.19.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 14 Jul 2020 09:19:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fna1NUmPIcQUshC2B8Rb/7i6GcHcLRQKFUoFpXK/9OsYuzjpgOV3iHcJC8HrBNPeFkAzqAbWfLK5riW219fFXS1wO8TnVaFsSmsQBQ9UP974FcT6SOWHhl48zr2GOX9jNsXDF7XRVWYXEWOClFbDrMkEoKGjYT/25jDFxTvDL0s5vPUe8XFK2jma4I1PS9uS02ZvHF5odfpvucZfUe/Wp3xAZu1wei9wwHa2ACwCY0weeW8IszdhqET83yly+j4hNOCMMHkoGtAlVQvC3caIXuRQ28tIIppQGYeURb2TBvCtKtSRJQmsrNDZ5866wUkZKi43swzFjgcV+GiKEsq2mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4d5b4Vgd/qL6VsnNQJbCMQO0zU6v6wWo4hxaRtbRo2I=; b=IzA9JF5KHjFS3DdUHhxFnH9u2F2//f4kLiye6jqzp4zRfgzQRRpq7kSc4jnvW323c3buL0+lOgyJ7PEkkQo8LzZ9sBdxV5L3EGEQekyrK/Om6d/ZBinKS1U3YZPlyUd12qUUz9cgHxLVeWkRA0hjIAZUuPDPr6R0RCq96rLCipx8aJvOKkJJetme7xByjvLQiYrPESL4kL3K/xCqh7nqVzycL6BwgT0I+BhcRf72gyXhp4rAW74f6lCcmNrfDdbq/oudAhaDRI+a87MM21kYWcspnfbX+SF0B6GBCTG0CPVnUjutncNVCxykU5skXf1T7myegzxAWKRhxVRH1waWYA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4d5b4Vgd/qL6VsnNQJbCMQO0zU6v6wWo4hxaRtbRo2I=; b=Vjvy/d5U+R2wzdPUjoSR+GaTLcO9AYSN1KS85vo0NnQhSoARHY1Dt5TbPlZaAu/iuGrpWJKDXh5isrvLMdDwoNV7BRisA+sWkLQr8jb2jvy6q8yDpPwoy5v9mXD9MAYPWaFb91ykjxnO7pq7xxFx8+K3lgpkfki4OBuGo/TE/FOHCIV1bv5JDrHE8GnS16JzK8XHZbO8ND7BO/5xDg2lwt8BAlsD/YZ/GQAVDEsDmI8Zlj1eq9CxnrTXuQ0UMi/jeN+MX9oEud20bRZtPpqdZ9aqvvkWEnZ1lJNiHUwsGMGS5x/8oQDOPg5M/MFSo69+iTjWBzGqLemjEfrBM73xag== Received: from DM6NAM11FT067.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::49) by DM6NAM11HT032.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::445) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21; Tue, 14 Jul 2020 16:19:26 +0000 Received: from BYAPR05MB6535.namprd05.prod.outlook.com (2a01:111:e400:fc4d::40) by DM6NAM11FT067.mail.protection.outlook.com (2a01:111:e400:fc4d::76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21 via Frontend Transport; Tue, 14 Jul 2020 16:19:26 +0000 Received: from BYAPR05MB6535.namprd05.prod.outlook.com ([fe80::54e2:1eeb:fc5d:8c21]) by BYAPR05MB6535.namprd05.prod.outlook.com ([fe80::54e2:1eeb:fc5d:8c21%3]) with mapi id 15.20.3195.017; Tue, 14 Jul 2020 16:19:26 +0000 To: Levi Morrison CC: internals , Marcio Almada Thread-Topic: [PHP-DEV] Changing default assertion mode to throw exceptions Thread-Index: AQHWWTwv4QCvmrJUGUWZUbSjZlPTfqkFyiIAgAFlKgCAABDL5w== Date: Tue, 14 Jul 2020 16:19:26 +0000 Message-ID: References: , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:218B50B141421C5246278B0AC29669A54FC9A1D53C4AB3AC51F3A24384781DD4;UpperCasedChecksum:2AB9B877D3A7D3334FA954E5CFFE6E51BC01D72CAB56E4DFBF50EC7EAB96760E;SizeAsReceived:7118;Count:45 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [flAn2w3f5wnp3bTIHpSuTi3IaT/k5kEp] x-ms-publictraffictype: Email x-incomingheadercount: 45 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: aeea1834-77cd-4163-33d1-08d82811ad61 x-ms-traffictypediagnostic: DM6NAM11HT032: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 8arrypRDNPZpIu7/2KWLRKQhUqz7Ij0Awx2si9lVtpMVFks6Cb8szEJpIur5KBtHPuFqoNzZxIuuwhswpC0nE49W2lGXingR01/VGbLFK5EiYo2G7F51kIGtJd1uQ7BPV0vqOwOCjsrHI2bHebsu3jmCrB+UNRdBo2z0mpOg0/k0pYWPgU40OFxn53UEGBcyfvvkXVtGtxcwvLrEvmJDv3hGe1RuGeA/fUuNqKMpUwy8tzBye0bZRrf/JqjCvi+V x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR05MB6535.namprd05.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; x-ms-exchange-antispam-messagedata: 2OGCT2Bzfr5hgo9kkU166WAk6EehVnEVCAf2sn+5lZ6GBQc2XIY8cYPFyDVFVhK9Y5nLZ+VVx3fVZZvR5grDFiV8iVybhgihXe6XTz8dZ1a17kOhoPKN3jD8vcuLaAlTz1+izsr5+SHP9yuun/dTgQ== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT067.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: aeea1834-77cd-4163-33d1-08d82811ad61 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jul 2020 16:19:26.1029 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM11HT032 Subject: Re: [PHP-DEV] Changing default assertion mode to throw exceptions From: theodorejb@outlook.com (Theodore Brown) On Tue, July 14 2020 at 10:10 AM Levi Morrison wrote:=0A= =0A= > On Mon, Jul 13, 2020 at 11:52 AM Marcio Almada wr= ote:=0A= > > > I'd like to change the default mode of assertion failures to throw.= =0A= > > > The current default is to warn. In my opinion this is a bad strategy:= =0A= > > > the engine asserted that something that is expected to be true is not= ,=0A= > > > so executing further is a bad idea. This leaves throwing or bailing= =0A= > > > out. I think throwing an exception is better than bailing out, so=0A= > > > that's what I propose.=0A= > >=0A= > > Couldn't agree more, but I always assumed this BC break could be=0A= > > too big before. Did you make any research on the impact already?=0A= > >=0A= > > Otherwise +1=0A= > =0A= > Nikita put together a search of top packagist repositories to look for as= sert:=0A= > https://gist.github.com/nikic/8311ee63c72573d514217456bf2df552=0A= > =0A= > We can't generally know what their ini settings are, though.=0A= > =0A= > In my opinion this change is worth any backwards compatibility break=0A= > as we are choosing the worst setting except for ignoring them=0A= > altogether, and can be changed back to the previous value using an=0A= > existing ini setting; we just need to put a note in the migrating=0A= > guide.=0A= =0A= Big +1 on changing the default to throw. The current default of only=0A= producing a warning is surprising and can result in code continuing=0A= to execute in a state the developer intended to prevent.=0A= =0A= Theodore=