Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124216 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 825061A009C for ; Thu, 4 Jul 2024 10:48:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1720090208; bh=aI5QMu3vA40uIv/8p270bv8Q31LGwX1V+aH5bVwup7M=; h=In-Reply-To:References:Date:From:To:Cc:Subject:From; b=FnuamLY7BkyVnBG+Ln48r9iyRY8Ii3L3kjFiVB3GMtxth0A1+hDhPOJMlwCK0KTZM 4Jg31ZgshEKLb1TfJr0jonZXTzNnSdvip0Tfu3A/wrz/CjtplLcQQ0k/ie+zCFjRVx QmM/rKEmOV2PJR6yjWigx+Tp6yZ7tT8J/p4MPNyWOhd9TAswQVtjAA/v5/102qSKM1 cI6RbXhyRV5xSAe3rqFRsO5E9FepFsoUmc10Gt+BzvGogmHJUYAfrOyrG5XCzjNZO9 0fHj4AO+3OXAvKxxbVJm5mOoNIWc8KURy8B9RYmTjfXRgURhBx0HeGS9MnQ9uIpZoZ mCgCmXVBp9Kng== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 490A2180077 for ; Thu, 4 Jul 2024 10:50:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,HTML_MESSAGE, RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from fhigh1-smtp.messagingengine.com (fhigh1-smtp.messagingengine.com [103.168.172.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 4 Jul 2024 10:50:06 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 17E9E11402D8; Thu, 4 Jul 2024 06:48:44 -0400 (EDT) Received: from imap49 ([10.202.2.99]) by compute1.internal (MEProxy); Thu, 04 Jul 2024 06:48:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bottled.codes; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1720090124; x= 1720176524; bh=/sTgkuHLdTNaEINRMn319yqYymrHSuuKpASbYYdZ6ms=; b=e KpUND3RF2BsIm9+y74zIG7Rbi88wDsM/38zj7J7tR/JAzT0EqDsJLVN58C5CvHjW 01OFMbolPlWZeuDrMIY14adjjt3oceA4S6tSLNPEiZFm5cnE3Sbyr1jJfcG0MUks TS+Wza67C094xrrFXkELklMlMKB7BTPlnCBfmGqedFOUmLfMKohWuQkNW8Rxk6/J 792HEEEZvI5UoYWcyPK7Btjw/TZRv//43n6D5nobKz3RYj3+GjFpZYLTohzRPkW0 XxPsMPvkkbpgtiPjEJm+aCKMcaMpJjtcTTfG7Qtm9U8tXw7bfLz+jmwZfpVPJcyb cCmQqgkrGlEWiNq3YeFJw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1720090124; x=1720176524; bh=/sTgkuHLdTNaEINRMn319yqYymrH SuuKpASbYYdZ6ms=; b=MgtOCi2FFS5QfYsSQGlWz8AA++hXFZUfkKAjGSO66Gxu qVTHqH5EDrD1czIhxNkzt88jrSr/hQk8ii+RVyfymFzGflsiiY2MeSjgYvnwfVPX uNvaOUFdRXupEVYOP2eAFWzruJCEJcIIOoL+nQzEOB39rT6GMCw22vStGQ6pxuYs mg68dXPknQubWwAwibZXekynbnXPHkrrVQxjkwKNkPREOD4U9pcSuupNXq4IPNxx O8bhI0hQJrgTgJxMumgaLN/pA8vRRStmeOd5o2Se9Y9F3KM8aAk4+9J4Bk+YnusI TIyVAfqJ2uFqBgtCZgKebyC+tYnu4Ou8vzJWK5qniA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudelgdefudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenog fuuhhsphgvtghtffhomhgrihhnucdlgeelmdenucfjughrpefofgggkfgjfhffhffvvefu tgesrgdtreerreerjeenucfhrhhomhepfdftohgsucfnrghnuggvrhhsfdcuoehrohgsse gsohhtthhlvggurdgtohguvghsqeenucggtffrrghtthgvrhhnpeegvddtveevleehfeeh ueehudeufedvheffieelieehleefffetiedviedvkeduudenucffohhmrghinheprggsoh huthdrmhgvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mheprhhosgessghothhtlhgvugdrtghouggvsh X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 4BD2D15A0092; Thu, 4 Jul 2024 06:48:43 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-566-g3812ddbbc-fm-20240627.001-g3812ddbb Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Message-ID: In-Reply-To: References: <09559430-4477-4516-8D78-6F4071E1AA6C@newclarity.net> <0182F3D6-F464-477F-9029-A2D0A8B50C71@koalephant.com> <1AFD7AAE-8BEA-460D-88A8-15BB3D30A775@koalephant.com> Date: Thu, 04 Jul 2024 12:48:21 +0200 To: "Ken Guest" Cc: "Matthew Weier O'Phinney" , "Stephen Reay" , "Vincent de Lau" , "PHP internals" Subject: Re: [PHP-DEV] Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript) Content-Type: multipart/alternative; boundary=f746141533f14ca7b0cf7664f020fac3 From: rob@bottled.codes ("Rob Landers") --f746141533f14ca7b0cf7664f020fac3 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable On Thu, Jul 4, 2024, at 12:37, Ken Guest wrote: >=20 >=20 > On Thu, 4 Jul 2024 at 07:32, Rob Landers wrote: >> __ >>=20 >> My main feedback to PSR=E2=80=99s is that they are fundamentally brok= en due to being outdated. The idea behind the standards is sound, but th= ere are only a few PSRs that are applicable to today=E2=80=99s PHP. When= I look at creating new libraries today, PSR=E2=80=99s are a good inspir= ation, but they probably shouldn=E2=80=99t be used in actual programs. H= ere=E2=80=99s a short list of outdated standards I=E2=80=99ve collected = over the last couple of years: >>=20 >> =E2=80=A2 7 >> =E2=80=A2 11 >> =E2=80=A2 15 >> =E2=80=A2 18 >> =E2=80=A2 20 >> Most of these breakdown if you start dealing with fibers, various new= scopes introduced by runtimes, new http standards, etc.=20 >>=20 >> Ergo, if you=E2=80=99ve run into these issues, you are likely incline= d to stay as far away from PSR=E2=80=99s as reasonably possible and may = have a negative view of them. However, for enterprise applications, PSR=E2= =80=99s are a godsend. So they do have their uses, don=E2=80=99t get me = wrong, but if you want to use technology newer than 2019-ish, you need t= o avoid them; and this is a large part of why I say PSR-XX isn=E2=80=99t= a valid argument on this list. >=20 > This is one of the reasons why we [FIG] now have the concept of PHP Ev= olving Recommendations (PERs), which can be updated/evolved over time wi= th multiple releases - instead of having having a succession of PSRs and= having to know which one supersedes another. >=20 > The only example of this thus far is PER-CS for Coding Standards - ver= sion 1 being the PER equivalent of PSR-12 and version 2 of PER-CS being = an update addressing syntax in PHP that was not present when PSR-12, e.g= . match, enums, attributes and all that other wonderful stuff. > =20 > There is no reason why any current PSR can't be replaced with a PER eq= uivalent - given a Working Group, time and focus. >=20 > Except maybe PSR-8. >=20 >=20 >=20 > -- > http://about.me/kenguest/ If I could have one to be a PER first, it would be the container interfa= ce (PSR-11). When it was originally worked on, there was basically one l= ifecycle of an object: a request. For almost all possible SAPIs, after t= he request ended, everything was gone. Today, we basically have multiple= ones if you are using modern runtimes: 1. Environment Scope: configuration that survives execution of the prog= ram 2. Global Scope: services/entities that can exist beyond the lifetime o= f a request, but may or may not (depending on runtime) 3. Request Scope: services/entities that should be unique for every req= uest. 4. Volatile Scope: services/entities that should be created every time = they are injected. Right now, these are all mixed into one giant container, that may or may= not be shared between requests, because that is the interface we have t= o work with. It isn't great :| but it works, barely. =E2=80=94 Rob --f746141533f14ca7b0cf7664f020fac3 Content-Type: text/html;charset=utf-8 Content-Transfer-Encoding: quoted-printable
On Thu, Jul 4, = 2024, at 12:37, Ken Guest wrote:


On Thu, 4 Jul 2024 at 07:32, Rob Landers <rob@bottled.codes> wro= te:


My main feedback to PSR=E2=80=99s is that t= hey are fundamentally broken due to being outdated. The idea behind the = standards is sound, but there are only a few PSRs that are applicable to= today=E2=80=99s PHP. When I look at creating new libraries today, PSR=E2= =80=99s are a good inspiration, but they probably shouldn=E2=80=99t be u= sed in actual programs. Here=E2=80=99s a short list of outdated standard= s I=E2=80=99ve collected over the last couple of years:
  • 7
  • 11
  • 15
  • 18
  • <= li>20
Most of these breakdown if you start dealing wit= h fibers, various new scopes introduced by runtimes, new http standards,= etc. 

Ergo, if you=E2=80=99ve run int= o these issues, you are likely inclined to stay as far away from PSR=E2=80= =99s as reasonably possible and may have a negative view of them. Howeve= r, for enterprise applications, PSR=E2=80=99s are a godsend. So they do = have their uses, don=E2=80=99t get me wrong, but if you want to use tech= nology newer than 2019-ish, you need to avoid them; and this is a large = part of why I say PSR-XX isn=E2=80=99t a valid argument on this list.

This is one of the r= easons why we [FIG] now have the concept of=20 PHP Evolving Recommendations (PERs), which can=20 be updated/evolved over time with multiple releases - instead of having = having a succession of PSRs and having to know which one supersedes anot= her.

The only example of this thus far is=20 PER-CS for Coding Standards - version 1 being the PER equivalent of PSR-= 12 and version 2 of PER-CS being an update addressing syntax in PHP that= was not present when PSR-12, e.g. match, enums, attributes and all that= other wonderful stuff.
 
There i= s no reason why any current PSR can't be replaced with a PER equivalent = - given a Working Group, time and focus.

Ex= cept maybe PSR-8.



<= /div>
--
<= div dir=3D"ltr" class=3D"qt-gmail_signature">

  1. Environment Scope: conf= iguration that survives execution of the program
  2. Global Scop= e: services/entities that can exist beyond the lifetime of a request, bu= t may or may not (depending on runtime)
  3. Request Scope: servi= ces/entities that should be unique for every request.
  4. Volati= le Scope: services/entities that should be created every time they are i= njected.