Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115422 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 5482 invoked from network); 13 Jul 2021 13:55:02 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Jul 2021 13:55:02 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6046C1804AA for ; Tue, 13 Jul 2021 07:18:31 -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-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10olkn2041.outbound.protection.outlook.com [40.92.40.41]) (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, 13 Jul 2021 07:18:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SmzSPPipQHlU1awWTj4YcHs/IXkFtUDC0/x3A7knZC5zgncHDgqvFiiUA/TzY0Sisuv5JC5Rc+3cqfgiGeRv0J4FwmdKR5NtAPT5tFGN1Iam04cDwuXRMcSSLp+q1PrNwkjo1Nx+A7t2750G7J3u8w73upeLhO2Tb+zEy39U4SHDkt8mGNn1AzQrtVKxOOUnDClh79TAWwBEZtfaIiFTEcClSzporPT2yu+1pV8imf9Yiub3jRm1iLZ8JndWCkMNA2OaYEKSBw3/0qx3DFAMwUN7HKBg9R+i4sghB4jhYm2S8LBacJEeHyCYyqllH9SEtOsSf1obodkN6/5j06a2wg== 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=mMe7qCqGTT1N9iDpixiI2WmSAPpo8KJHS4IecwSa1yM=; b=KUtbraXU/cXah44GkUZoSLtmB+wJWjpV5WVi3A8qDZAXr7O1bFajoPuKvrTp6gaXOw46tTGqJfcMOzAs6fPosxpJWV8I4hbl0l1RbrE+0ZzsSt48hbsmWnfXBVSkQueClskfttWTR/WbG1g21trjd/9K3JHmxXwEoXuHqfgh5E/nQBhiyzmVpbMllSHNmW49G3aKWnbvU5vNEZMlbtmqv1bP0Z75eEsZTMmpTdE/gRdOJzI/5d0qTQqQmihpacAV1YuO1juKDQwFEceX9HvsN735aorLHPCKI/1JZN4iJfIvpIT55H2PvhhM6X8Q9I+MpFKmJrMd/CouYjr+MA5mfQ== 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=mMe7qCqGTT1N9iDpixiI2WmSAPpo8KJHS4IecwSa1yM=; b=KCUk/dX99PZv/EDO6igwpvVnBIhJp4n3tbcqS5PYPe6WSG4ZlfW7KtEn4GLyjv7Q544stNvCBcrDRVTy5GqMNrlK464u5vHhb2Rq//YhSum4pY+/sbggjNxjQBvCeHvr/az+Uh4Rjk4VTyF1T3rTJrU3Wc0x3zhMaS6JyISDOpV074xo4LDIlWhh6NgJ7btOx40GzU6rW80IazwI/FIuMH5WJuWan65QrrQM4R1nU1+dnMHyv28MHkm0JG7EWn5uX8IITRuCmObKq+wLPJBFYACut3CmfzRtC0BVqdGv6dUvPQb5nk/fAKh9uQdoyk65SePWt7qCnYQFgUJ1D0GobQ== Received: from MW2NAM10FT067.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e87::46) by MW2NAM10HT178.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e87::480) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.20; Tue, 13 Jul 2021 14:18:29 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com (2a01:111:e400:7e87::4b) by MW2NAM10FT067.mail.protection.outlook.com (2a01:111:e400:7e87::76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.20 via Frontend Transport; Tue, 13 Jul 2021 14:18:29 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::9dbf:271b:5e16:dc88]) by DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::9dbf:271b:5e16:dc88%3]) with mapi id 15.20.4308.027; Tue, 13 Jul 2021 14:18:29 +0000 To: php internals Thread-Topic: [PHP-DEV] Changing method naming in FFI Type Reflection API from Arg->Parameter, etc Thread-Index: AQHXd+yHhG4u7tRODEilHBKBJW2Z/KtA8kgAgAAAWVQ= Date: Tue, 13 Jul 2021 14:18:29 +0000 Message-ID: References: ,<10a6e57c-394a-4966-b6dd-52d6ec38b6ea@www.fastmail.com> In-Reply-To: <10a6e57c-394a-4966-b6dd-52d6ec38b6ea@www.fastmail.com> Accept-Language: en-CA, en-US Content-Language: en-CA X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:5C0C4AC8FE7FB479E0D21D51001394234CE1F265A057B544169FF177C4250731;UpperCasedChecksum:7A9547A669ED66390B9024A83626B465D1917A05FA594B4DC70146F008263B73;SizeAsReceived:7194;Count:44 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [b/n63GDAYR43CLymt9tQJaEO7kunl1IsgPJ6eKOt6xyw2Kx3aUCc5r8wE3RrhWMJ+ex3A1mZ7wo=] x-ms-publictraffictype: Email x-incomingheadercount: 44 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: 5f4f8a9f-df9b-4226-0605-08d946091644 x-ms-traffictypediagnostic: MW2NAM10HT178: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: zvjkIAyxN/w4zeAbeAKqEI3gobFxZGQuKzvoDPzl3pKnP0DjjjkUssG8BURU74UeRKIJcwMouiVS8qo1BTfrNm2UBE1p5f560/2D7RXLJyJA3LUTFuCLc0EwvWx8WbwTKssJXuOUH7VKsnTXJqacKspPbjGI7AHIjfSi7y25zuCrCZoXTSWlj/HV9WKYWO806fd5ALsF9Iik6WDvQYDWcVp5hCFddDZwuO4CKCbb5WyYVDPwUvaVVlEIUnBxKUqIPP0m5Hn2VMVKJGOHXNc3kD5iOa0oQG0o416t3RUMIko5eV8SoxRLyK5Eu3HVtW44oJgQGg9AS1A6jvGQO6LlwjxcxZW+hn3Gvo+6nHZzqqICVUO3DpTL72ds9CrggPoM47sAPTYdm1oOfNroeghALbED+Y0Y69YahvKhv/CACFAB1jY/dthsPxv85qqZSexESMjr0jklz5sWYAWqyuyi25N0sZEB96OuJ5hO3WV03lg= x-ms-exchange-antispam-messagedata: rWdAEIp/SlpcQq5fDgK7FQy1rTQm6eqa+AUpTu07OjvanJN7XygAqvfxPqeNS6Ytn/f0fYn3cvgkFrkO7MPsrZonXcXkxfFDGbrvNMyQiT7rZ70UOPDYeNBiVsL/Rw0dn7e+7+lKhJv+iN112VSNz0zh+0K50K3ar8YXvJkLBcV8bmob98LDc7yket5yM1ss9nfv5Vmz30DY28IMA9aHHw== 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: MW2NAM10FT067.eop-nam10.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 5f4f8a9f-df9b-4226-0605-08d946091644 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jul 2021 14:18:29.0973 (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: MW2NAM10HT178 Subject: Re: [PHP-DEV] Changing method naming in FFI Type Reflection API from Arg->Parameter, etc From: tysonandre775@hotmail.com (tyson andre) > > The FFI Type Reflection API mentioned in =0A= > > https://externals.io/message/115336 was recently added=0A= > > =0A= > > My opinion is that that they should be renamed to use the same naming = =0A= > > scheme that PHP's Reflection extension is already using.=0A= > > Having different ways of naming very similar concepts (different from = =0A= > > https://www.php.net/reflectionfunctionabstract) would make the language= =0A= > > harder to remember.=0A= > > I'd brought that up in =0A= > > https://github.com/php/php-src/pull/7217#pullrequestreview-700990479 = =0A= > > with no response=0A= > > =0A= > > What do others think about the name? I was considering holding a short = =0A= > > vote=0A= > > (on getReturnType, getParameterCount, getParameterType) before the =0A= > > feature freeze if there was interest=0A= > > =0A= > > In particular,=0A= > > =0A= > > - FFI\CData->getFuncReturnType should be changed to getReturnType - =0A= > > only functions have return types=0A= > > =0A= > >=A0=A0 This is consistent with =0A= > > https://www.php.net/reflectionfunctionabstract =0A= > > - I believe Arg should be renamed to Parameter and Func should be =0A= > > removed from names where redundant.=0A= > >=A0=A0 E.g. getFuncArgCount should be renamed to getParameterCount =0A= > > (getFuncArgType should be renamed getParameterType) - only functions = =0A= > > have parameters,=0A= > >=A0=A0 and PHP is already already using "Parameter" instead of "Argument= " =0A= > > for reflection on types elsewhere.=0A= > > =0A= > >=A0=A0 Parameter is used to refer to the function declarations (AST_PARA= M =0A= > > internally in the AST, ReflectionFunctionAbstract->getParameters(), =0A= > > etc.)=0A= > >=A0=A0 Argument is used to refer to expressions passed to the functions = by =0A= > > the caller (ArgumentCountError, etc.)=0A= > > =0A= > >=A0=A0 Other languages use similar definitions, e.g. =0A= > > https://developer.mozilla.org/en-US/docs/Glossary/Parameter=0A= > > - The discussion over where FFI arrays should support Countable::count = =0A= > > (and non-arrays should throw) might be contentious so I'd rather keep = =0A= > > getArrayLength=0A= > =0A= > This all makes sense to me.=A0 Consistent naming is better unless there's= a very specific reason to to otherwise.=0A= =0A= Created a PR https://github.com/php/php-src/pull/7236=0A= =0A= Actually, looking at this again, I don't see a need to drop the "Func" - th= ere's already getFuncABI.=0A= =0A= If you look at the current implementation, there's getStruct* for structure= s, getArray*, getPointer*, meaning `getFunc*` sort of makes sense for a nam= ing scheme to make it easier to find functionality associated with a given = func.=0A= =0A= Still, I find my proposal of Arg->Parameter continues to make sense to me.= =0A= =0A= Thanks,=0A= Tyson=0A=