Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130823 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 lists.php.net (Postfix) with ESMTPS id DDECD1A00BC for ; Mon, 11 May 2026 07:18:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1778483887; bh=8Npsru0QKoyOiXGIiRlFiykoSox5S8XHU7XI2P3wIzM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=JSMPQDrG11XBYhLHtg8hVl1Qr3iSaTnjNJ0Qqxxj2SPgcHdMMsJHZjWuWA2j9H2KL TQNZ6a+Sgi2pGnKvP28OC9wNV2egUw5BFvYwFrmcNvHJG18pKM2q5QD/mUpaZqgr3J 3+ulJNuSoYTsEQHPdrRgc2X5tRD6DBdj3I8K/UoADJgA0qBDP174pSF7EXIkms+B4Q QfI01LURb2fgnK4WXfD8AbYmJA1Y94q7OPyc4XKZka8+9MY5yXbufLmbIIop5Uwd7u mtgiwAgxG/ltVhmydzX357NqH0OWCxcWKMBFHqIiru8x+GCieclrErWMgcD+LfF/Vs bf/V91ynrPbcg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A7D55180050 for ; Mon, 11 May 2026 07:18:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) 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_MISSING, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-vs1-f50.google.com (mail-vs1-f50.google.com [209.85.217.50]) (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 ; Mon, 11 May 2026 07:18:06 +0000 (UTC) Received: by mail-vs1-f50.google.com with SMTP id ada2fe7eead31-6314287380bso1652206137.3 for ; Mon, 11 May 2026 00:18:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1778483880; cv=none; d=google.com; s=arc-20240605; b=AgMFArJdF4TffMZmiesF4n6nVKwNUC3OBt3rAYP4bCKHOdJZJu/dy60D3lMIN2VY0g W7B7a4vNnX2YSLPscL4LqN9PsB3ystr3LF8A15RbEsUr3vhgqm9cW7j3A+W7q8xTPVWO wchijAosY98J0tdVaU8yKkpw+mpm6mKx/Ka15bPWWUMtR70+fdHBL7vpnUwuMAsHZahW 30cz47gWCT+X99O/Yr+tguLiXNwc4DK6NKtsTqYf75PI69QPwcJEG9DRptq8EDdfEtmc j4u5wOHeUKwX6fg8lKIuqKkw6xNCfa3iftsAcOW9Aus4WHVklESBPBJftWZSJE2a9Ye6 fKYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=8Npsru0QKoyOiXGIiRlFiykoSox5S8XHU7XI2P3wIzM=; fh=l3g8zqwBVfukB0+m5XdnlwTyS9Plew+VzbkjVfzp6Zs=; b=ZNrXuocHh0+qxQwQEVveO/SPb9P5UqV55xamhYnFJ7Rkc/Hs69CCaY2SCvlDKkovpB WpmhLpU6MbFHM48/Ejo7BL6aljxbXBthttRWmgZ+Ct0rm0bJHCsi8hd2aRqenA6lLN+L 0kh7+iaRZNeQwppb0TDzmZleeRa0VjWRkcIxIdEHePppMtwrzX08rf7jaBBQfl4Uycko /5Uzlhua7RddbxqDmxVbVosxEsFE310PMnrSjTLjzt9yyxfcjGxMOpEL9u6tY1/uvOlP qC6jTyvAz4lXvVrcFPlHawaGyu+qqMs+E09XdC1g+b5SM2/Ut7rueOpR4zcKreL5G2+q SHYA==; darn=lists.php.net ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=carthage.software; s=google; t=1778483880; x=1779088680; darn=lists.php.net; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8Npsru0QKoyOiXGIiRlFiykoSox5S8XHU7XI2P3wIzM=; b=g89bTmlLb89SqPZTbxgiBydMJM4UiRkjnNVhT/CI0YNgqLN+O/rJcQGbpX+Cs4/Vp7 AJKoDZYl+JAEEZ9bmZO6VeIOvOSRfcizDTM8Hrb4CpXlhb+Eavy1/gqi5eIyfOfvj4Et 320j215cUeulK/mzKwhewVBPrXbEqmFVsFD+YPEeF2m/L5vvXjSCpTiiZxY9fMTGEPl9 H3NrgAsgrZ7C+d9aZXRbeBdC+YD7zm5brCsvQC9XPkPVpsyobm5dl9V/AkKnUAb57l3t bj9wxO9jTb4ov0/1kJrb6ww5TTcKekA581PnmDLRowiOx4ju/+WBI2gDrTXD4nOB9APH KlJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778483880; x=1779088680; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=8Npsru0QKoyOiXGIiRlFiykoSox5S8XHU7XI2P3wIzM=; b=SE2ueBHWs1uuQtMmSuA+uF3WkLt0qaWSORFyYWaJGWHl0JjYbNg8o3wKgF1WA9VnWw N1bBeTxItxYO82CPozhQVL7gxab7d2UcYcruWZiCYVgvSc+rjGS41WiqpvPX1Qtp6LXa b8/vuKVZuZtc+5hBeHPATGodV2F+m84ihMD0FMbTpCEntefZAe8V6DL6DxoSo5Oe9vHf uz4xxH/OXguGElxpZctyTjj/JC3iolBmOUJqYHVcm8BkiuImPdaeMMhEXtFBjF+3UKoa IpErpLCFCI4WhH4yiWZu0vH2dk9kAX7Uh6VWMjnPOCrHLVX0KZt4rTbEPz+sKOeHJmYZ K9cw== X-Gm-Message-State: AOJu0YyM5ZiabCMH9FpR+YjEcvhBKQRwKlLUYuOtMS512+etq8aiFMMY dfWXQxQlBbnodRXGE0NwCGok57euWtoBc3ydxuIO4bsgBbNnxY2EPjHU57bwN47ZDW6iuKu4t/J 3HTvlC3sMGI+HltlqgjWwFbZ9Ej+qMlSuqzk57fxsTA== X-Gm-Gg: Acq92OF3duQo7QBIiUDvTerd+QvczW1gmgMhWuQCl+IR47iQIwV9/J7q2oUpi07f4td Lhz+wFvL/s8UX/UpZmaxjgATauh9LFsCQZw6VSoJateEPn6z0bV6fXsIO5dpDSX63F363nCC+Mr /8V/VAeST/5qiVuICy3jex9+FRSzGDEqzlYhwfna/GM5aBoxJXf062R0sDyxv2XbnDl7+sDutRn +k2XCNNdoK5GvMYIxt4FxgVBRAQBlGdkDm5dDPEOp5cKHXCGHbsakgwn2PEuM+mSKOv+XIznxHc RhVXWXsEv1EVpK2vXg== X-Received: by 2002:a05:6102:5cc6:b0:634:eb91:695 with SMTP id ada2fe7eead31-634eb911661mr352544137.5.1778483880418; Mon, 11 May 2026 00:18:00 -0700 (PDT) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 11 May 2026 08:17:49 +0100 X-Gm-Features: AVHnY4I_U4yKOzmU1XDvySNpM7QfFFb4xGfI58Rwp0s40mjtSsk8E1tEXS1SHa4 Message-ID: Subject: Re: [PHP-DEV] [RFC] [Discussion] Bound-Erased Generic Types To: Levi Morrison Cc: php internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: azjezz@carthage.software (Seifeddine Gmati) > > On Sun, May 10, 2026 at 1:05=E2=80=AFPM Seifeddine Gmati > wrote: > > > > Hello Internals, > > > > I'd like to start the discussion on a new RFC adding bound-erased > > generics types to PHP. > > > > Generic type parameters can be declared on classes, interfaces, > > traits, functions, methods, closures, and arrow functions, with > > bounds, defaults, and variance markers. Type parameters erase to their > > bound at runtime; the pre-erasure form is preserved for Reflection and > > consumed by static analyzers. > > > > - RFC: https://wiki.php.net/rfc/bound_erased_generic_types > > - Implementation: https://github.com/php/php-src/pull/21969 > > > > Thanks, > > Seifeddine. > > Seifeddine, > > This is a very interesting RFC, thank you! > > I have a technical request: can we lower the limit from 255 to a 7-bit > max? I've done tons of optimization work in the last 8-10 years of my > life, and having a spare bit on things for the future has often been > rewarded. And for me, I can't imagine a use-case for having 128-255 > type arguments in practice. Do you have any evidence that a 7-bit > maximum would be insufficient for real-world code? > > Thanks, Levi Morrison Hi Levi, Good catch, lowered. The cap is now 127 (u7), with the high bit reserved for future per-site metadata. RFC updated: https://wiki.php.net/rfc/bound_erased_generic_types#the_127-argument_cap Honestly, there is no real-world evidence either way, no PHP codebase approaches either 127 or 255 type parameters, so this is purely about reserving headroom. Thanks, Seifeddine.