Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105211 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 19060 invoked from network); 10 Apr 2019 18:35:54 -0000 Received: from unknown (HELO NAM01-BN3-obe.outbound.protection.outlook.com) (40.92.0.100) by pb1.pair.com with SMTP; 10 Apr 2019 18:35:54 -0000 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=QYDZi3ZoDKoJC0nBJweCRVMEa+9zFxS3/eGTXcL/rR8=; b=QJbsemyRdt1PplU20mVzGopc49k5/UHT5cBRCctLE3iObZnzIoUgoq+90AQ/gX8J64b/KOWjNbfdwPKcKc0Jz+cRdd0gwRPlL9YNB+93h+DfQlSDJkeq2PBgvE1HLgs7kyntUD1Gc4oSqsaofgn2phgRvhdxODuzcYgipHfKbFSnWcafjhWK1zY/+yPh4GYde67sZ8nEWOPrXQtRd6KvfafwGE3iEMNjV3gUzbfjmM0yTvO4SzeqkB6+soiwhdakUdUeVYVdGFaeoDVEAFP1lMLNbWuqTwJi5Ct4EHCSV2iSpzjbmX0s0Y3lsy2hgWzru9cxjZ++bf++Y2eG9deF4A== Received: from BY2NAM01FT017.eop-nam01.prod.protection.outlook.com (10.152.68.53) by BY2NAM01HT234.eop-nam01.prod.protection.outlook.com (10.152.69.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1771.16; Wed, 10 Apr 2019 15:33:03 +0000 Received: from DM5PR06MB2857.namprd06.prod.outlook.com (10.152.68.51) by BY2NAM01FT017.mail.protection.outlook.com (10.152.69.207) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1771.16 via Frontend Transport; Wed, 10 Apr 2019 15:33:02 +0000 Received: from DM5PR06MB2857.namprd06.prod.outlook.com ([fe80::447:30c5:3c4c:5294]) by DM5PR06MB2857.namprd06.prod.outlook.com ([fe80::447:30c5:3c4c:5294%8]) with mapi id 15.20.1771.016; Wed, 10 Apr 2019 15:33:02 +0000 To: Gabriel O , Levi Morrison CC: Dan Ackroyd , PHP internals Thread-Topic: [PHP-DEV] [RFC] Always generate fatal error for incompatible method signatures Thread-Index: AQHU7q3ZkDUlFRPPOUWDfKA/8jHC06YzqPQAgABACYCAAAOHgIAACdIAgAAIcACAAXwuvIAABZEAgAAG9XQ= Date: Wed, 10 Apr 2019 15:33:02 +0000 Message-ID: References: <3BCEA463-BD9B-468B-AF26-E0AD75C5F559@gmail.com> <16a029d2430.27c1.08be835b7d1a2c2edb4c4286afe1a236@gmail.com> , ,<16a07c8fe70.27c1.08be835b7d1a2c2edb4c4286afe1a236@gmail.com> In-Reply-To: <16a07c8fe70.27c1.08be835b7d1a2c2edb4c4286afe1a236@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:1B32477BA24323CC08650D59A7A03D94561A1A77792E7DB721DD547E9BBE1F20;UpperCasedChecksum:9B444508D09ABD6C61B1FA64AB04C57A785B3AE35F4EA3C1BB11E3B4F7DB66C4;SizeAsReceived:7485;Count:45 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [1soykACQcyCD0+0VXEeJ792DmnumZ7Eq] x-ms-publictraffictype: Email x-incomingheadercount: 45 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(20181119110)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031323274)(2017031324274)(2017031322404)(1601125500)(1603101475)(1701031045);SRVR:BY2NAM01HT234; x-ms-traffictypediagnostic: BY2NAM01HT234: x-microsoft-antispam-message-info: EcGJB0tnCqnsaPaZHiBLJKcCfOMWp895GQSfYzgJ2cKEIkuUjkFdjF3jI+Xlmvxy 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: f98cecd8-097e-4e71-704a-08d6bdc9d1d3 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Apr 2019 15:33:02.5134 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2NAM01HT234 Subject: Re: [PHP-DEV] [RFC] Always generate fatal error for incompatible method signatures From: theodorejb@outlook.com (Theodore Brown) On Wed, April 10, 2019 at 10:06 AM Gabriel O wrote:=0A= =0A= > On 10 April 2019 4:48:38 PM Theodore Brown wrote= :=0A= > >=0A= > > I for one would welcome consistent fatal errors for LSP violations,=0A= > > to catch these kind of bugs as early as possible during development.=0A= >=0A= > Once again, nowadays warnings are converted to errors during development.= =0A= > This change affects production only, where this isn't being done.=0A= >=0A= > > Have you considered testing=0A= >=0A= > I have yet to see codebase with 100% test coverage. Better idea is to use= =0A= > static analyzer. My objection is for remaining cases.=0A= >=0A= > I don't understand what's the benefit of raising fatal error here. Code i= s=0A= > not lsp compliant? Cool, you will get hard error when calling such subcla= ss=0A= > anyway. Until that call happens, there is no bug so warning is fine.=0A= =0A= =0A= > I have yet to see codebase with 100% test coverage.=0A= =0A= True, but I would think that after upgrading a library, one would at=0A= least do a basic test of loading the code that uses the library to=0A= see if it still works.=0A= =0A= > Until that call happens, there is no bug so warning is fine.=0A= =0A= I disagree. There is a bug, but without a fatal error at compile time=0A= you are less likely to find out about it until the relevant call happens.= =0A= =0A= > I don't understand what's the benefit of raising fatal error here.=0A= =0A= Besides the benefit of finding bugs earlier, there is also the benefit=0A= of more performance optimization opportunities that Levi mentioned,=0A= as well as simplifying the PHP engine. [1]=0A= =0A= [1]: https://github.com/php/php-src/pull/4000=0A=