Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125161 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 305151A00BD for ; Fri, 23 Aug 2024 18:28:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1724437812; bh=EnczBRXC806Xr3J6OTJ5lmoQ5H8iMXVHDhNlZHHtnhY=; h=References:In-Reply-To:From:Date:Subject:Cc:From; b=cqpEyNJ1XGcOvecAD8NaRBvchlfyUBgLk1Y12CfKtOqR+p7qmAZOIKU3H2xG5YFvY 60VeJ2CiSNTfZcnen9z0bJ3sBNNnmklZ7aoyKx9t/VQ8B9P3mUlnxr+r+nQRqIpNNH Mp0PuguUMJvp0E/Xjri6PKlxyaFsYI4XGpYZ6OIRxLKq7gAW4PXO3wuVG/yE0ITE1L JPCGiVqhL+HtW7LnHbi+RxGWWKthETKKC2qasntfwKCyMRpfjM0eC0ho7AWFrisxix Sy5ofZ0DiPHIVZIUw2rTpUMeGGltS7pyyRVaJLFB0Wdx835Y+7UGTarFwI00zWNRjK TE+3jsNFtjgEQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 101D1180531 for ; Fri, 23 Aug 2024 18:30:11 +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=4.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,MALFORMED_FREEMAIL,MISSING_HEADERS,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (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 ; Fri, 23 Aug 2024 18:30:08 +0000 (UTC) Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a7b2dbd81e3so313845766b.1 for ; Fri, 23 Aug 2024 11:28:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724437696; x=1725042496; darn=lists.php.net; h=cc:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=eDWifPfz/4/Klrp9WiZWg1SRu7FT2hdH+xid5cab00w=; b=az6aLrY1zZqsXZoyVUVlkUDjuvo+5PZIGjKOdrMYT9lJ1xtR+fAfvAsWWUizhGV4kJ hUjVTLjkXNUlK6YSiQO5q4JvbXEkqSOg4EUZ/6x9J0vm+Z0I7DP00b++PJnOS9s8CGW7 GNeo+5H7c7VHeSBwkNY3KsZCiAvy4gwr96M2rg24RKJVzTlr9ONXAB+ZfD9iFumIqC8K Dyx9GZUY9zxLsGdeeejp/YO9l5Rgfr4OXrRCwYs0Y2H+qt7o/Mhv7rNuvYutNbS5vgnX EcQPrfVbCdXN8fa4WyvVj3wcNN6nZHIIQqOBv2g7nOnsZItbLPypLFEc6dBVQ08Gki/E cQVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724437696; x=1725042496; h=cc:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eDWifPfz/4/Klrp9WiZWg1SRu7FT2hdH+xid5cab00w=; b=tlyRLGLSoT5u5Kwnt09seEKfBM4dApaSBhHMb17QDZ1zXl4VRPz4dpchB+4311R0n2 5I2I+4KgmMQWWM8kzsXLCdY0wVH56cVG689Jk+Lms+Nc0sc6Ukd6Acct0NoAW2N2M2lJ iejxq9O+37kDyu97AKVq1ITlZGcy5YAYLY/n5KJQGcTneFahx32nuWdQp2iQhHfDXEg4 k/hJL2WtiMHReEn0bVIV93YFT7vKv0zK71PtFY1+giu/bJtMXGOJ8bKP7rAycIUKWlNJ YLWOpmXpHpe0z8vcxHwv5QM7R9oh41+AITDoYCJfNDzrqzGOhod3in898qSDkuwnYv7+ oWAQ== X-Gm-Message-State: AOJu0YwKhq0LD/LR5VR02x1jByzwTPJUKGLlt0wTjqfVIOnqOmLEPYXt 2kLdl4qPg+8kfiLP+gFb7rYs36jHyJHWzsG9XuAQWs5LI09azcK/8JPcPf3xf/hFgpPRb8ayw4t b4/OYE5AelWVYxsOn2GqjhuGl4twICndH X-Google-Smtp-Source: AGHT+IHC0DsDklcFs113WB055vxMYiPcfZho/lx3KhcnVjYmshq+opIxfOmT89dtq/bXFWfATmqEdHYGL5chweX3cNo= X-Received: by 2002:a17:907:9724:b0:a86:9176:ea1d with SMTP id a640c23a62f3a-a86a5165964mr273886166b.7.1724437695717; Fri, 23 Aug 2024 11:28:15 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <1b59392a-68cb-36eb-0fef-977ac7113520@php.net> In-Reply-To: Date: Fri, 23 Aug 2024 20:27:49 +0200 Message-ID: Subject: Re: [PHP-DEV] State of Generics and Collections Cc: php internals Content-Type: multipart/alternative; boundary="0000000000004a670906205df063" From: weirdan@gmail.com (Bruce Weirdan) --0000000000004a670906205df063 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Aug 23, 2024 at 4:27=E2=80=AFPM Larry Garfield wrote: > Moving those definitions to attributes is certainly possible, though AFAI= K > both the PHPStan and Psalm devs have expressed zero interest in it. > Part of the challenge is that such an approach will either still involve > string parsing, That's not really a challenge and would help somewhat with the current status quo where we have to guess where the type ends and the textual part of the comment begins. But it gets ugly for any type that has to include quotes (literal strings, array keys, etc). Technically one can use nowdocs, but it's not much better: https://3v4l.org/4hpte > or will involve a lot of deeply nested attribute classes. Yeah, that would look like Lisp's S-exprs, but much worse - which, in my opinion, would harm adoption. All in all, in my opinion attribute-based solutions are less ergonomic than what we already have now in docblocks. --=20 Best regards, Bruce Weirdan mailto: weirdan@gmail.com --0000000000004a670906205df063 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Aug 23, 2024 at 4:27=E2=80=AFPM L= arry Garfield <larry@garfieldt= ech.com> wrote:
Moving those definitions to attributes is= certainly possible, though AFAIK both the PHPStan and Psalm devs have expr= essed zero interest in it.
Part of the challenge is that such an approach will eith= er still involve string parsing,

That'= s not really a challenge and would help somewhat with the current status qu= o where we have to guess where the type ends and the textual part of the co= mment begins. But it gets ugly for any type that has to include quotes (lit= eral strings, array keys, etc). Technically one can use nowdocs, but it'= ;s not much better:=C2=A0 https://3v4l.o= rg/4hpte
=C2=A0
or will involve a lot of deeply nested attribute classes.=C2=A0 =

Yeah, that would look like Lisp's S-ex= prs, but much worse - which, in my opinion, would harm adoption.
=
All in all, in my opinion attribute-based solutions are less= ergonomic than what we already have now in docblocks.

<= span class=3D"gmail_signature_prefix">--
=C2=A0 Best regards,
=C2=A0 =C2=A0 =C2=A0 Bruce Wei= rdan=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0 mailto:weirdan@gmail.com
--0000000000004a670906205df063--