Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115420 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 465 invoked from network); 13 Jul 2021 13:28:02 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Jul 2021 13:28:02 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E8C151804AA for ; Tue, 13 Jul 2021 06:51:30 -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 NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11olkn2013.outbound.protection.outlook.com [40.92.20.13]) (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 06:51:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T0UOssOGWF7fapnI+t/n7IWPqq9PlyGor4TjYoXWJEw6MHdSsOqiPBzW0Xn0e9owpD7yDKZGAl06PuFsfj62uQCrsRSNZuQU6g/RC/UBUoPxnpGtZrclrXWnBAU13X4VnRapiBgaLraIYRaZLG8dR7nnHgtKsZEahQePDp7dFgoARIL2gq2BkYuQhFit0fG8OiiJp4bx4UukgtuDt0m10hY1YRb4YYIVhSLKHCedZZmHDJpBZWhBLe+zpLp5rq+9fTZH/WPJvBR5pKWZ0PCsrDbwNEw5pkB/x+gAcVJiQF8hVDkUQku7ITh2+yRjUTNerL8DYvJnSGs+7r5Lmmglhg== 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=n1Em5TPAXThyXstLu5OZOaDAl0xd+rIGWDWoo3e1mPc=; b=XZyD8iUgoNjRaOaGNjo4qRpgc3pamVwNlQOVVaqdhw5CxjyMhqTGOL//iX1A/cRSdPUVxS1skccPxmUupTZa80VOwsLcN6N1QS9Qz504cvsgfVB1uGkYRaPgrw4UeV0anZmddWeghtQpZgFSOjMe/20fzhAHrO3Bp++39aDG2xmR0F/t1IWifRx6F5k3rN33xnF4LpBVb9cSE+SRkcG/S3Sgtmu52CSgfcc96GqQVpMn2nzJdcFIuFkdPfMw2gJ1JGcRzbj36zSt9vsqUv2ztO68zW7Ltm8bXF/JswnjwLxC64b51cHZPT4vfqF8xZ34/Z8NLUHxtQy0HxJwc3dhNQ== 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=n1Em5TPAXThyXstLu5OZOaDAl0xd+rIGWDWoo3e1mPc=; b=NnZdGaAZFVoy6w/E91GNVs5NK2Pf0Itm53Xk1lrxvtYushSrBYCo1iFQv/a2Z5NZVJ+WjIcWO/ajo3NwHk2fnSwPjhq5O5zRZ1bVMB/XPHeLP2FW1/mjfiefU56AJDATzyQhxu+bW7c2FgpdQTQQESyGpXmZzmZ8AmUtVIG/EfRhfvDojlLvI/50N43QodZl8bORJ/LwsSnzMP/UKEWyD8jLTqIu3YjgxWTCGKdG74sAO5GuvpjNhXd/a7t62TveTGOWUamAr7xbbLBkCKDmnzO6j7ZFONZFWhEIjTkLw4Zi1yd+wZziz1A/6dTX8NW8QSZTPPNG43gJpt0TS0KDgA== Received: from BN8NAM11FT044.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::48) by BN8NAM11HT157.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::469) 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 13:51:28 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com (2a01:111:e400:fc4b::46) by BN8NAM11FT044.mail.protection.outlook.com (2a01:111:e400:fc4b::475) 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 13:51:28 +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 13:51:28 +0000 To: "internals@lists.php.net" Thread-Topic: Changing method naming in FFI Type Reflection API from Arg->Parameter, etc Thread-Index: AQHXd+yHhG4u7tRODEilHBKBJW2Z/A== Date: Tue, 13 Jul 2021 13:51:28 +0000 Message-ID: Accept-Language: en-CA, en-US Content-Language: en-CA X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:20D4379850644D796940473AB1B6867320D636211615CD749582595D2F937A7A;UpperCasedChecksum:AC7484C8E7260668529FF0A627DCC281AAF19FC7E4777251E7455FFDAAC686F3;SizeAsReceived:6902;Count:41 x-tmn: [SyMaK5MDb9PXA/1/rC/zqxQ+hawmh07FKACiNAhvcre7MwfoUoJ6L8u0Xx4zADSEGrDAwl/fPuI=] x-ms-publictraffictype: Email x-incomingheadercount: 41 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: 78aabfa3-f255-47c8-20c2-08d946055085 x-ms-traffictypediagnostic: BN8NAM11HT157: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: yYZuvlMOfwa3hzzTNHbUoQtVNGqvCOyazaOIVd+dOlCxUIyolAWXGZ4rZIRmRZhuFUTDV5+JOjIcKVMalgEIJq6CYbqgS1f+rxtW8XOThngRXoZ4enc3Vrqkkl+Ex9B5IZDSHEpD7nAZCWGTzf7mv84tGUH+cAc0tMkzWSa28jn5YlrWcDA0E3/hXMW3zSYfzOUiF9DQwVaS8fkS3x1G8SP3FrpaepiXzlFKwtaxCWRkE/vRiLr/EF+uP5hi1bj62x7vj5t7Ka8zLs4ShzTqbXaNtw/V9qT9Xe0DXDIgaRBVt49gP4LO2dMehH8PryFLhDLXXHZXtEOQTVzIOscqO2Kw7U00EAZe61Sy5lwEA54GhHXlHb0RegbeETYC9VDZ87b8chystXx4uIkVAuZKEmdA6C1CxO6nD5GnxAyOR12Jf2Sb0WHeLBrXdlsaqGXUZk+TbVNbfca9V6oqIFg8kOIgEYmrwQyGnIpQK0/+8SM= x-ms-exchange-antispam-messagedata: PTR06tzGys/5e77DoTMDM1Qq1kQItAgw5U3fDRyp10LD7+Q6lhzqIS3mCZQZ5caO4rUQZlhQcrdXdBeYH/Jm77P26trbQQxeCcjGrJnkcnfZV7Nyw9hhELqltoiXjS4ZaI0e8D4B+RhGluObErzvqnqOyLPJfo/QVJqvlmhpNxkEHAoloKJ3GPWbOt5zaCifjfW0d3CBI50gMAXJR+reSQ== 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: BN8NAM11FT044.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 78aabfa3-f255-47c8-20c2-08d946055085 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jul 2021 13:51:28.7949 (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: BN8NAM11HT157 Subject: Changing method naming in FFI Type Reflection API from Arg->Parameter, etc From: tysonandre775@hotmail.com (tyson andre) Hi internals,=0A= =0A= The FFI Type Reflection API mentioned in https://externals.io/message/11533= 6 was recently added=0A= =0A= My opinion is that that they should be renamed to use the same naming schem= e that PHP's Reflection extension is already using.=0A= Having different ways of naming very similar concepts (different from https= ://www.php.net/reflectionfunctionabstract) would make the language harder t= o remember.=0A= I'd brought that up in https://github.com/php/php-src/pull/7217#pullrequest= review-700990479 with no response=0A= =0A= What do others think about the name? I was considering holding a short vote= =0A= (on getReturnType, getParameterCount, getParameterType) before the feature = freeze if there was interest=0A= =0A= In particular,=0A= =0A= - FFI\CData->getFuncReturnType should be changed to getReturnType - only fu= nctions have return types=0A= =0A= This is consistent with https://www.php.net/reflectionfunctionabstract = =0A= - I believe Arg should be renamed to Parameter and Func should be removed f= rom names where redundant.=0A= E.g. getFuncArgCount should be renamed to getParameterCount (getFuncArgTy= pe should be renamed getParameterType) - only functions have parameters,=0A= and PHP is already already using "Parameter" instead of "Argument" for re= flection on types elsewhere.=0A= =0A= Parameter is used to refer to the function declarations (AST_PARAM intern= ally in the AST, ReflectionFunctionAbstract->getParameters(), etc.)=0A= Argument is used to refer to expressions passed to the functions by the c= aller (ArgumentCountError, etc.)=0A= =0A= Other languages use similar definitions, e.g. https://developer.mozilla.o= rg/en-US/docs/Glossary/Parameter=0A= - The discussion over where FFI arrays should support Countable::count (and= non-arrays should throw) might be contentious so I'd rather keep getArrayL= ength=0A= =0A= Thanks,=0A= Tyson=