Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123896 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 DBF7D1ADD2B for ; Wed, 26 Jun 2024 21:15:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719436628; bh=9wxZAfmO4EjGayWvv4kFsuXBhE+ccY1Rp0nkefG6yU0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=H4+KU4Tk2r2RQCTchOgAabs1GHfhFGKWHc/9CAeQqiZnabeTcsZx9eCoSutYd2GTO sj2it0d+Tn5NsXp67ves5HNripJY9IrHWeZHI6kEJ6zS9SIhXe7GnF1joMP8mVQPah odrZ3tJGL/+LxGQNBohwvxOclvLwRY9e0LEe0aVTAy4MqLLoPz7oRMXCShm0o7Ex1l Dd5se+nZGiLOH+HQkRIRCz04s4NDkUw0Xw0mJ2inPdWp1wjN32NWnAEBy9VAA+9syU pymZg+vILsDh1wR4khZxgTEPbt0dU4AaHmeAC8FsoXZY9sXdkOJyxorZr9oT+q8BLM D/XwVxyg/9PLQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D074A1809EA for ; Wed, 26 Jun 2024 21:17:05 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, 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 mail-vs1-f46.google.com (mail-vs1-f46.google.com [209.85.217.46]) (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 ; Wed, 26 Jun 2024 21:17:04 +0000 (UTC) Received: by mail-vs1-f46.google.com with SMTP id ada2fe7eead31-48f5ae5cf20so1265984137.3 for ; Wed, 26 Jun 2024 14:15:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719436545; x=1720041345; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=MDA9Lw0Z49A1TIa492RoTxoGVpyHmuAcCyZ3Uq/QZNY=; b=fz1ptIm2eiQu2IEOW4eJ6N3kFLRt0mjASGw3T6KYaEEn461rYUZYmalErJsSKwq1jZ daEQKICUd2e4UFuWGq9LUrRimkhIDKoHKHeFGGwXjpTQpXOBNR4j812VJLt1sCbyx8fs NdaaSsL77yAuPTQX8FoHW/KoSA+U3AwQ/EH8NWPvNCnZphwFSyEXLH7s9dcJ/q8kMOeL d9dVisjuje3QasHHpObNb90IXYur9xiP4aS2no3lPOL87Dk/D1v+65BRcO9JGJRBKBmZ 4KV13F8RhSmQ9uoDGlpZIDJXJYa47rtWAKeDcGv3YXzqynumgKD/b3BL4SFR7oubpEYa rMeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719436545; x=1720041345; h=cc:to: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=MDA9Lw0Z49A1TIa492RoTxoGVpyHmuAcCyZ3Uq/QZNY=; b=wYfkhNR2+jQrtfFxmyMI14Z477Stx85xNRGzjMyOV1Kzzvh/sK1+fUpi5//gqNlJBn KaJVkcANN5i8LBnpJM4kEKXkF6KaJLdRFWSP9oIVjW4i7geOqN14YN1zKXDNnIF+kG6+ sGr2GfI/YobbW6qbC1b2qMw2vb0zmYqV/On6AQfPJqR7wK2YyNXVvHCuLIIQI3FHCEmv aLY3IwMZMEfXSh86G4kdMzITZO53Nl7Kl8WkPEh2dO7F2GF/KrIYmmkcd9KAqlhBobxE 7xn6sFMI3JJwhocz32QUdrfhWyOPF4GsG+JctNbVGOOdf7EbHYFPuHlcapIKS1Gz23+a QEnQ== X-Gm-Message-State: AOJu0YzwCVdSwf7/tqW7TJg3/B6BEWCYnWi8qg6/9wXOCKlf8tCnBNYv CBnG7D2gEkLhsRvsUBlqTDqNhdEOaVT/hyF5Ul0jiL74V+MmhTAQeLDAHjca+Rmr9rCQcPcJ06N RaMlFptad1fSPYZZKBBzxuqoL1dM= X-Google-Smtp-Source: AGHT+IEKqUAy0zH3kQqiOfzYokE+MKJ0ODTEANPffhrFKSaLkZKI1BHB2QX+ozKm5zBAGWQgHknseGKG3ET8Lh7vgZo= X-Received: by 2002:a67:f8d2:0:b0:48f:394c:36fd with SMTP id ada2fe7eead31-48f52b9da8cmr10619401137.23.1719436545544; Wed, 26 Jun 2024 14:15:45 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: <6D0733B2-A1D1-45EC-B93E-029B1616A22F@miles.systems> <71dc8137-ded0-41dc-bc9b-32dde12f9170@app.fastmail.com> In-Reply-To: Date: Wed, 26 Jun 2024 15:15:37 -0600 Message-ID: Subject: Re: [PHP-DEV] [Initial Feedback] Typed Arrays To: Bilge Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="00000000000082dc42061bd18420" From: lnearwaju@gmail.com (Lanre) --00000000000082dc42061bd18420 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jun 26, 2024 at 3:10=E2=80=AFPM Bilge wrot= e: > On 26/06/2024 21:56, Casper Langemeijer wrote: > > Generics or bust. > > > I do not understand the reasoning behind that. Is it because we really > want generics, but when the 95% use-case is solved we fear that there wou= ld > not be enough momentum to get that? I'd love to have generics too, but a > very simple array syntax would in my opinion still add a lot of value, ev= en > if we already had generics. > > It's not that there wouldn't be enough momentum; if anything, a successfu= l > typed arrays PR could give rise to such momentum. If it were possible to > have typed arrays that were fully compatible with an (imagined) generics > specification then I would be all for it. The problem is, how can we ever > ensure compatibility with something that doesn't exist? > > It seems to me we either solve is problem properly (with generics) or not > at all. > > Cheers, > Bilge > I disagree, in fact it would be super easy to make T[] translate to array if generics ever become a thing in php, but it doesn't make any sense to keep holding off on implementing this just because it might not be compatible with an implementation of generics that may never come. Cheers, Lanre --00000000000082dc42061bd18420 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Jun 26, 2024 at 3:10=E2=80=AF= PM Bilge <bilge@scriptfusion.c= om> wrote:
=20 =20 =20
=C2=A0Generics or bust.

I do not understand the reasoning behind that. Is it because we really want generics, but when the 95% use-case is solved we fear that there would not be enough momentum to get that? I'd love to have generics too, but a very simple array syntax would in my opinion still add a lot of value, even if we already had generics.

It's not that there wouldn't be enough momentum; if anything= , a successful typed arrays PR could give rise to such momentum. If it were possible to have typed arrays that were fully compatible with an (imagined) generics specification then I would be all for it. The problem is, how can we ever ensure compatibility with something that doesn't exist?

It seems to me we either solve is problem properly (with generics) or not at all.

Cheers,
Bilge


I disagree, in fa= ct it would be super easy to make T[] translate to array<T> if generi= cs ever become a thing in php, but it doesn't make any sense to keep ho= lding off on implementing this just because it might not be compatible with= an implementation of generics that may never come.

Cheers,=C2=A0
Lanre=C2=A0
--00000000000082dc42061bd18420--