Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114845 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 52963 invoked from network); 13 Jun 2021 18:59:51 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Jun 2021 18:59:51 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4DF181804A8 for ; Sun, 13 Jun 2021 12:15:55 -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.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, 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 NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10olkn2040.outbound.protection.outlook.com [40.92.41.40]) (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 ; Sun, 13 Jun 2021 12:15:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TXf5e73gaCu8S9WRateBfqsItEk3P7cCxQGpO6vCmiXJej3qRYN3o26PfuiWhZLxDT7p3SNmVhCcAVd1xVppdNre44G5bwAxwjVbjyRqSh4BtmLGaO4MgdvvzPtJH9teYeVbhsZKYeHrdKe36tJdFhvF/YnXEBRSCqY6R5IpcE615dVE84MLiN2aYsbBj7EpeAxZXP18j/acKzhRUdBYdOT46opAJWoFIN/ZaemnLDvJon4fG+Q1i6RwlfC6zghlQJph82esGSdn+Rm8BFRObbEbpUzgoiUG8kvA3UQIRQYrDgRSrr6akb0gQCcF5cFYmtGV8xhNOUD0knbL8Nsvbg== 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=w9hQ2clNUAAzCCLlSYzfrgbQ5wOq119lK5AKZAEmHyg=; b=WYG73yFUP1tR/nzARW0Zk4eBy3lVqDGE98f85WpkuXOi0rPwtzRy+AylEPwta+Eot4JJB3bdQzfrFkWOJEUVw7Cb7PzQbls21IjaGWNE2VcglJ2Tbj3zM4VzCplYQNO36/7OfantHfp6E2P0l5QOe7H7rteIJbLAI1aM3AiGQV3ktflQ6kGN2csYxAILy14CVmHlqiqiIReUHXGBkDkTiNSviZN2VQlRo2fqfEy0eY0IKBEFJmXNlQfyjARA1sYo6/F78z8VZ4mD6GlnWJL5+sZ39Nb0P5dMDEbBq6cT2bB7O2oGZCPIMrL94ejk6Lyi/GI/zMIRFSuLwooHkJrC2A== 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=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=w9hQ2clNUAAzCCLlSYzfrgbQ5wOq119lK5AKZAEmHyg=; b=sOTj/5n1cox2Ft43k0Uza6wuNfm9kj70/TI3+9VksVEVqbDuB9eFq/yRf5vWDpQXxrBoXEVteUC5e0mADysneAP7Rd7jYoVBald1e/UxgzCE7yBGxl+wXiFKft0JCJMbY0n2kgZWYiTpMkIj7sxoqMs+Q//JzRJVq8ZkXJhillcROP6+vv0pncrGfaKyoTJDmusMDGvZl+pIntw81396fmYfl0XUHMIgNMZ25AVUvfd8P84om9IsUKknb4FfTDdZToSCKs6Cqcyxjn28JYstB7zwSIoEPzP7a9bdHO53NqvAFXNglSpiDjERRpwzZK8J2z/lApi58p6xgLLu/bzACg== Received: from DM6NAM10FT067.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e86::4c) by DM6NAM10HT223.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e86::206) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.18; Sun, 13 Jun 2021 19:15:53 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com (2a01:111:e400:7e86::4a) by DM6NAM10FT067.mail.protection.outlook.com (2a01:111:e400:7e86::252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.18 via Frontend Transport; Sun, 13 Jun 2021 19:15:53 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::20ed:6cd1:4fe2:eea7]) by DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::20ed:6cd1:4fe2:eea7%3]) with mapi id 15.20.4219.025; Sun, 13 Jun 2021 19:15:53 +0000 To: PHP Internals List Thread-Topic: [PHP-DEV] [RFC] make Reflection*#setAccessible() no-op Thread-Index: AQHXYHNxlAlWlobnu0CiArnpthCGZ6sSTh+h Date: Sun, 13 Jun 2021 19:15:53 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-CA, en-US Content-Language: en-CA X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:37803063E6244736C48E955268B3B33E8DD097C5FD3728756AE5CBD806BA1443;UpperCasedChecksum:2C1AE6ABB868F8065BAC3B2F61DCFEA2A5E9277AB0ACAE66AB4009923F4A3ABF;SizeAsReceived:7036;Count:44 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [VV+0RqNXTDmCQupenCcGp+ZrJ3lShZVTXBzRvZ36vBcoo5Da/jQkGtFxpRqsr2XE] x-ms-publictraffictype: Email x-incomingheadercount: 44 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: 370492b9-312b-405a-df50-08d92e9faa09 x-ms-traffictypediagnostic: DM6NAM10HT223: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: QFcBrO5Vlwjj6GvJWUWm7R9N1ZPztxi1za8yG/GxU0Kyrgp4M+TDRRan/OXFo+pF8mhRJXyqo2WRH6lS+Ek0L2g2FmA6100KAZ/ERlt7iIu7QqpC1g5j64liff2JY7zIFidbS+PAomDIFhiyQVC9zk5BJpvreiaRcBlcWSGG5ogBcIgJ3+nZIh0k//oqdcZ0+8C+aBz9lP6x/XBfomXavyzYQYdJX2f4AMDKQr/C2mxeT5dzGloQWd9eSM9TU7IEhjeWzb1jB41B70QIjBxlt8F4zKW1lqyh9jA+mxhlZEvmwotVQdKXQxHGGLnHTjBYLUB2uieWthZYXzyZnlQOyE48TSDPCKlPtzSqtVL/cMuzUUJvV53YUE2fmI+4NWPcmqf3NTSqHhE6GRvGtSx0OesrAs1eILwkxqf43rThIP+tWaafLmeVkVxEG1KzdJR10B9wqmvyJiGDwsw/ws15mA== x-ms-exchange-antispam-messagedata: EbeOX4hX+GEQIXBYgENHLEb/mNBsSIwDkcwqL2G0mii+2wnMZKVQE3+jl74X0wrRR/MDB3RguB+fWYdVpwxLsWVBiP886ZuvW0g3oQwdto5EICmX1AG52ZadFPrtpFGsEiIIRJaLgXnnDBkK3WjpCHxWrYPiAoJ6PsucUPMDIJeoYpYfuZP9CcdcsQcko3r7OhODlItws9zrXnXBHyi+uQ== 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: hotmail.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-AuthSource: DM6NAM10FT067.eop-nam10.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 370492b9-312b-405a-df50-08d92e9faa09 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jun 2021 19:15:53.6497 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM10HT223 Subject: Re: [PHP-DEV] [RFC] make Reflection*#setAccessible() no-op From: tysonandre775@hotmail.com (tyson andre) Hi Marco Pivetta,=0A= =0A= > I'm posting here to introduce a new simplification, as well as=0A= > quality-of-life-improving RFC:=0A= > =0A= > https://wiki.php.net/rfc/make-reflection-setaccessible-no-op=0A= > =0A= > The RFC is quite minimal, and proposes removing any runtime behavior from= =0A= > `ReflectionMethod#setAccessible()` and=0A= > `ReflectionProperty#setAccessible()`, making `ReflectionMethod` and=0A= > `ReflectionProperty` accessible by default.=0A= > =0A= > The rationale is:=0A= > =0A= > =A0* this API is probably coming from a copy-pasted java-ism (although I= =0A= > couldn't verify that, so I did not factor it into the RFC)=0A= > =A0* removes the last bit of mutable state from `ReflectionProperty` and= =0A= > `ReflectionMethod`=0A= > =A0* simplifies usage of the API=0A= > =A0* if I'm up to no good, I don't need to actually solemnly swear that i= am=0A= > up to no good (that's stuff for fantasy books)=0A= > =0A= > I don't really know what the deadline for 8.1 features is, but I assume= =0A= > it's coming up quite quickly, so friendly NikiC poked me to see if this= =0A= > long-standing patch of mine was still relevant.=0A= > =0A= > Should be short/sweet, but I'm looking forward to your feedback.=0A= =0A= The deadline for new features for 8.1 is July 20: https://wiki.php.net/todo= /php81=0A= (with some discretion from the release managers, e.g. for amendments to cha= nges already made in 8.1)=0A= =0A= I think that isAccessible should be added if any applications actually did = depend on ReflectionException=0A= being thrown for correctness - they could throw their own exception if isAc= cessible was false.=0A= (e.g. for code meant to handle possibly undefined public typed properties b= y checking for initialization=0A= then getting the value)=0A= =0A= I can't actually remember needing this personally, though, since `$obj->{$m= ethod}()` could be used.=0A= I've only used this to access private and protected properties/methods.=0A= =0A= Regards,=0A= Tyson=0A=