Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117690 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 93086 invoked from network); 7 May 2022 17:27:53 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 7 May 2022 17:27:53 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2FD6118005C for ; Sat, 7 May 2022 12:05:56 -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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS29838 64.147.123.0/24 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 ; Sat, 7 May 2022 12:05:55 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 50CAD32001C6 for ; Sat, 7 May 2022 15:05:54 -0400 (EDT) Received: from imap44 ([10.202.2.94]) by compute2.internal (MEProxy); Sat, 07 May 2022 15:05:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ollie.codes; h= cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1651950353; x=1652036753; bh=Wy80MeyZX+ YWeTN8cCOZufYsD9TN/AZzKvfYJZCDcms=; b=KTqmWpFLSukqIqoJXipCzcWEvO DWqOMvfw/vbEkViMQgrIWR3LKC9dHIcRZvdtVmJtonimGNs0SvUXsy527kQa288z lmxko9s4MUsOHFXGRksKXIz8b2swqI3v+9UfjtBm+i/hwq98buzdS0uL3EDFUGAj 8GWEjduPBmZ0Pec5z6Fs7QPvsqXZI3OCldajyiQlb6QLeZ7NJORJXeQ58Qq+svXL m+GyW+yaJiCIukHf4AwuRrU5bGSGAtj6RCoDKpwN5dy2Mv5J5JeBkPaeuBRwjxAy STiBctHU4zes/1Uu113/87fr8HD+DQ+VAXvribd48HgNyNkLVVGOndv+lDIw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1651950353; x= 1652036753; bh=Wy80MeyZX+YWeTN8cCOZufYsD9TN/AZzKvfYJZCDcms=; b=P tnoqep3k20pc9E9sa5zHyKBlzKfq1YtSU4j5+pHEP0L1p3wCUd2jevLX7Bw1k4P8 q+K0uDrJaYwN3d33aNIPfIP7RLAg/Cts6LCHGyJsND1w2VQeJUCpzF3zR9dIXoGf WHCROEXA5ZmbNQcCu0TENouO13+SH7yD/nYa+dUnCMMAbd4iuqnXHtl5hutMuV7a 0HVIWXLQIgrhFVvcVcUdP+F8vueeq7y59Jzcp08pEwd8NkzkpetKgOV9tp4pgBNR k2vTwos39yF84v2lGG2KkuGrT7+xtV9Od508HbiOdWc7LZ4E3pvLsnjqc2AtEAeC xwtU5YLlG0B1sUQ4f3A3Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeehgddufeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtsegrtd erreerredtnecuhfhrohhmpedfqfhllhhivgcutfgvrggufdcuoehphhhpseholhhlihgv rdgtohguvghsqeenucggtffrrghtthgvrhhnpefhgfehleeugfdvkeevudfgleduteelge etfffhvdetvdejvefffedtfeefvdekkeenucffohhmrghinhepghhithhhuhgsrdgtohhm pdhmihgtrhhoshhofhhtrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepphhhphesohhllhhivgdrtghouggvsh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 7AD8C36A005D; Sat, 7 May 2022 15:05:53 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-591-gfe6c3a2700-fm-20220427.001-gfe6c3a27 Mime-Version: 1.0 Message-ID: <92b17af4-bed5-4014-becd-8eeee2430977@www.fastmail.com> In-Reply-To: <0eed8cd6-cf23-4eeb-ab3e-a851d0266081@www.fastmail.com> References: <0eed8cd6-cf23-4eeb-ab3e-a851d0266081@www.fastmail.com> Date: Sat, 07 May 2022 20:05:32 +0100 To: =?UTF-8?Q?Bj=C3=B6rn_Larsson?= Content-Type: multipart/alternative; boundary=fd80572a61934cfdbd3f0b4599fee427 Subject: Re: [PHP-DEV] Possible improvements to the Reflection functionality From: php@ollie.codes ("Ollie Read") --fd80572a61934cfdbd3f0b4599fee427 Content-Type: text/plain Hey again! > Greetings. > > I've also been doing a lot of work with Reflection lately as part of https://github.com/Crell/AttributeUtils . I agree with and support almost all of these additions. (I'm no entirely convinced by getNumberOfAttributes(), but I don't really see a harm in it.) Yeah, the idea behind getNumberOfAttributes was merely because it doesn't hurt to have, and since we're dealing with having 1 or more of a particular type of attribute, there are absolutely going to be times when has and get won't cut it. > There was another short thread on the list back in February?, I think, about some improvements to reflection. We desperately need a few more well-placed interfaces and stubs for things like attributes, and even getName(). My C-fu is paltry if I'm being polite, but I'm happy to help with process and RFC writing/documentation. The Reflection API is badly in need of some love. I'm super new to the list, in fact, this was my first interaction with it at all. My C-fu is practically non-existent, in fact, the first thing I ever did with C in my entire life, was the PR to fix the bug with closure attributes. That being said, I'm fairly confident that I have a decent understanding of how the reflection parts of the codebase work, and I've spent enough time poking around it that I think I know how to do most of what I have suggested. > In practice, I think most of these would require RFCs. The question is whether they're better as a bunch of stand-alone RFCs or one big "clean up Reflection" RFC or a series of "clustered" RFCs. I'm not sure what's most palatable to folks these days. That's a good point. I'd be inclined to, at the very least, create two RFCs, one for types, and one for attributes, as while they both use reflection, they're very different points that are only connected in that they're part of reflection. Since posting the original list, I even came up with an idea to expand on the typing, and introduce actual classes for each of the "types" (perhaps an enum), that the reflection types can use. I think that would be super useful for a lot of stuff, all the way from dependency injection to static analysis. Something like https://docs.microsoft.com/en-us/dotnet/api/system.type?view=net-6.0, but we could probably just make the reflection classes use that. I'd also like to see the Reflection prefix dropped and proper namespacing introduced, but I also know that's not going to go down well with a lot of people. Am happy to hear any suggestions or input, especially how people feel about the whole RFC side of things. --- Best Regards, *Ollie Read* --fd80572a61934cfdbd3f0b4599fee427--