Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115421 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 3550 invoked from network); 13 Jul 2021 13:49:05 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Jul 2021 13:49:05 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5DFA2180089 for ; Tue, 13 Jul 2021 07:12:35 -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=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 13 Jul 2021 07:12:34 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 9E35E320091B for ; Tue, 13 Jul 2021 10:12:29 -0400 (EDT) Received: from imap43 ([10.202.2.93]) by compute1.internal (MEProxy); Tue, 13 Jul 2021 10:12:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=bALgn/ DXfRnKTY+ucmi6Lofij/Ef+fa8j6by1GfjvZ0=; b=ZCLsnZweyisrOmvqbKonjj BvnKGsT6XnGNk5e/YinLK7PayuBNERSy64vtWfvoN1zlqR7QurA4u4mpXFHed2GX 2LUVS0BF6e2sT+HwfaGlf2nvoU0khRb6XD8pIpeMpHUo9AgMJ2iZssshjdyG4/0J zTjolIC7/xqdwfs8Xrtk+W5vy/ohrf3ipYpnsGwaU2TbT4+iyiF0vA48S1i1SFg0 9UiqdyzKvhGB2wzpJiG4U4GLU8iE/TtrL9M0tErfVRBSii0447z8f5tWRp4OCqBQ 6AmMm/EFsVPAQvoVONC0WKMqJgB8o9A04tyXGc7yxfcmLK4hNhX9N8i7Pml1IThQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudehgdeifecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtsehttdertderreejnecuhfhrohhmpedfnfgrrhhr hicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh eqnecuggftrfgrthhtvghrnhepveelveevvdffvdefveetfeegfffgudejkeeffeekgfdt leekueduueekueevkefgnecuffhomhgrihhnpegvgihtvghrnhgrlhhsrdhiohdpphhhph drnhgvthdpghhithhhuhgsrdgtohhmpdhmohiiihhllhgrrdhorhhgnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhgrrhhrhiesghgrrhhfih gvlhguthgvtghhrdgtohhm X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id E1C44AC0081; Tue, 13 Jul 2021 10:12:28 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-533-gf73e617b8a-fm-20210712.002-gf73e617b Mime-Version: 1.0 Message-ID: <10a6e57c-394a-4966-b6dd-52d6ec38b6ea@www.fastmail.com> In-Reply-To: References: Date: Tue, 13 Jul 2021 09:12:08 -0500 To: "php internals" Content-Type: text/plain Subject: =?UTF-8?Q?Re:_[PHP-DEV]_Changing_method_naming_in_FFI_Type_Reflection_AP?= =?UTF-8?Q?I_from_Arg->Parameter,_etc?= From: larry@garfieldtech.com ("Larry Garfield") On Tue, Jul 13, 2021, at 8:51 AM, tyson andre wrote: > Hi internals, > > The FFI Type Reflection API mentioned in > https://externals.io/message/115336 was recently added > > My opinion is that that they should be renamed to use the same naming > scheme that PHP's Reflection extension is already using. > Having different ways of naming very similar concepts (different from > https://www.php.net/reflectionfunctionabstract) would make the language > harder to remember. > I'd brought that up in > https://github.com/php/php-src/pull/7217#pullrequestreview-700990479 > with no response > > What do others think about the name? I was considering holding a short > vote > (on getReturnType, getParameterCount, getParameterType) before the > feature freeze if there was interest > > In particular, > > - FFI\CData->getFuncReturnType should be changed to getReturnType - > only functions have return types > > This is consistent with > https://www.php.net/reflectionfunctionabstract > - I believe Arg should be renamed to Parameter and Func should be > removed from names where redundant. > E.g. getFuncArgCount should be renamed to getParameterCount > (getFuncArgType should be renamed getParameterType) - only functions > have parameters, > and PHP is already already using "Parameter" instead of "Argument" > for reflection on types elsewhere. > > Parameter is used to refer to the function declarations (AST_PARAM > internally in the AST, ReflectionFunctionAbstract->getParameters(), > etc.) > Argument is used to refer to expressions passed to the functions by > the caller (ArgumentCountError, etc.) > > Other languages use similar definitions, e.g. > https://developer.mozilla.org/en-US/docs/Glossary/Parameter > - The discussion over where FFI arrays should support Countable::count > (and non-arrays should throw) might be contentious so I'd rather keep > getArrayLength This all makes sense to me. Consistent naming is better unless there's a very specific reason to to otherwise. --Larry Garfield