Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106809 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 29752 invoked from network); 30 Aug 2019 06:51:48 -0000 Received: from unknown (HELO NAM02-CY1-obe.outbound.protection.outlook.com) (40.92.4.14) by pb1.pair.com with SMTP; 30 Aug 2019 06:51:48 -0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SjaPGLk9y3u50zMVjSUYG1Iji7MwHbfHL339GMfhecNrw6KaMz6JFD9mFmg+rnmas8VDp/fyP6fWX+hGbuZKdYZByhRV8kUXeOCLY5XrCG/O9vt0Gmvdoegshe2PpIedMnejift+aeR4Ikji0smG8ZVAC8FOHcUASWsCNjL6DgXT5A2Dy7s2GnDtHVdCalta8lRUcCRJi0e8FCaaqW5YF/9pWQOeXnVlBbOE0Kw9r3N5qn6kCXfeSsQqkWzXrNDc2AVNaCREG+qNEvbvvrZ8cmtX2goDcoau45WePImK2YXq6rw0/klY8K/te5nt2ueqcKfQhf3M6vXx325CiCAi/g== 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=xMB2M9Jo+p4jLLMJG2HVqFLrCfFXI2uhMKAC0r/IYYg=; b=jvgNWYRvtSN80V/Bp2T0ao/xT9qux5u+Px3XM6lQHkC7Cqy2vY0g8I6WcY+J6I4eWUMcotiF7ysWSlzPey2m0cMJGO9NnHiLND6N3cdWFWa8NUa1kgnbEM8GUO1F5efZ5cCWTWX4VVTL4NbfrXQe1rpqlrtG5FuOc7KrOHWxbCu3qpuHiwF4G06bH+hURrmChVq7B50GwTnLT4vGAX/8IEU3stVX5N4+dkmkRK3NkbysfiAJiDMPCLBrz5XOX4laAC9XnkpXyR/+vnZhIlzqpphsnujjNd+cDs7T2k9ZHBMCQRt0WRAOBWhvNlWLvOWmOP6AGdINiHO6HIzLT+xIRg== 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=xMB2M9Jo+p4jLLMJG2HVqFLrCfFXI2uhMKAC0r/IYYg=; b=Q6+tT05V+GmZeU8PlhmsW2PVTOkKbwhIHmPrPQVsrKpAd/tQgPqSjcDYLgdYgZANeYgqbRD5/X+uLhoAjHEVs7m8EDqt4PgfkUPN58NomNV6AG7Hlqk7pSLUYUsrt7UKlMSQa4nAdMztHixz8knk+5EsgJlpibHMrZKz1JDKWMsNuwWCeH9zgx6zYFWtnTMl+r4qsX0IGj1TJtJEBy4zJoGQjYhJ0s1qCWd0J8pwF/lWAvjGWdhpkKYzDPndzNclPpcXVmK0uWvEiBMDQcUfGy1QJQQkC41iKFuOycOp+5MLUuSfAb6iXvgEdiKTm6YcVTeNKSVTydB5FcWxvDBc1w== Received: from CY1NAM02FT004.eop-nam02.prod.protection.outlook.com (10.152.74.59) by CY1NAM02HT033.eop-nam02.prod.protection.outlook.com (10.152.75.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2220.16; Fri, 30 Aug 2019 04:24:21 +0000 Received: from DM5PR06MB2857.namprd06.prod.outlook.com (10.152.74.60) by CY1NAM02FT004.mail.protection.outlook.com (10.152.74.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2220.16 via Frontend Transport; Fri, 30 Aug 2019 04:24:21 +0000 Received: from DM5PR06MB2857.namprd06.prod.outlook.com ([fe80::513:ea72:aff1:7db4]) by DM5PR06MB2857.namprd06.prod.outlook.com ([fe80::513:ea72:aff1:7db4%3]) with mapi id 15.20.2220.013; Fri, 30 Aug 2019 04:24:21 +0000 To: Nikita Popov , PHP internals Thread-Topic: [PHP-DEV] [RFC] Reclassifying engine warnings Thread-Index: AQHVXYOxCjumqQXyj0iAUvYbrqIX4acTFmys Date: Fri, 30 Aug 2019 04:24:21 +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:28DDCA44F2177C5BF9134B533C5D0F1A4B37D7109E8797BBECE3D683884E9370;UpperCasedChecksum:8355CDC5DDFF31B20B2F53E889763DFBA50EC4B78E3BF42DAEA1E146E0A657CA;SizeAsReceived:6791;Count:43 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [vSQhJR2q6w9xwNX7EDbNeG7Nj9X1t1v5] x-ms-publictraffictype: Email x-incomingheadercount: 43 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(5050001)(7020095)(20181119110)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031322404)(2017031323274)(2017031324274)(1601125500)(1603101475)(1701031045);SRVR:CY1NAM02HT033; x-ms-traffictypediagnostic: CY1NAM02HT033: x-ms-exchange-purlcount: 1 x-microsoft-antispam-message-info: 3k+zpqv7jXiHKAUfy14pY+ZraXVk8tkwvrT0ezl15e8tQ5WVnEXwI12by2PLceUudPTd0zwyX9P03eSxNwI7Sv7wqm9qxvO1OgUDFTpxVOgeUBE5orF57FtJFAh8pzo+kkocYfnoUmLXUb+afQ68JxtHgu7b2JX2yQq+r54SeBhDW11ADo7IFe0m+5rX7JVW 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-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: cffb4dfb-a9cf-49dc-d2df-08d72d01ee73 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Aug 2019 04:24:21.3780 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1NAM02HT033 Subject: Re: [PHP-DEV] [RFC] Reclassifying engine warnings From: theodorejb@outlook.com (Theodore Brown) On Wed, Aug 28, 2019 at 4:33 AM Nikita Popov wrote:= =0A= =0A= > I think it's time to take a look at our existing warnings & notices in th= e=0A= > engine, and think about whether their current classification is still=0A= > appropriate. Error conditions like "undefined variable" only generating a= =0A= > notice is really quite mind-boggling.=0A= >=0A= > I've prepared an RFC with some suggested classifications, though there's= =0A= > room for bikeshedding here...=0A= >=0A= > https://wiki.php.net/rfc/engine_warnings=0A= =0A= Nikita,=0A= =0A= Thank you for your effort in putting together this RFC and explaining=0A= the rationale for each change. From my perspective, converting more=0A= error conditions from a notice/warning to an exception as proposed=0A= will be a welcome step forward for the language.=0A= =0A= I've frequently used PHP to write one-time scripts for migrating data=0A= between services, or scripting changes to thousands of items via an=0A= API. The lack of exceptions for things like undefined variables and=0A= using a scalar value as an array has bitten me on multiple occasions.=0A= =0A= There have even been times when simple mistakes like a typo in a=0A= variable name have led to data loss, since instead of causing the=0A= script to halt it just output a notice and continued running with=0A= bad data.=0A= =0A= In my experience, PHP's historical lax treatment of errors, far from=0A= making it faster and easier to write scripts, *actually makes it take=0A= longer* since I have to add extra assertions and boilerplate custom=0A= error handling code in order to ensure that scripts don't keep=0A= running in a broken state when one of these errors occurs.=0A= =0A= So in summary, I think the proposed RFC is a solid step forward which=0A= will help prevent expensive mistakes and make it simpler to write=0A= robust code.=0A= =0A= With appreciation,=0A= Theodore=