Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128409 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 E07C81A00BC for ; Wed, 6 Aug 2025 12:07:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1754481943; bh=orepQlYWz69Q/pwUAfkF/YCQXq06qKcUH2Bfe75G638=; h=From:Subject:Date:References:To:In-Reply-To:From; b=YNvM8dKPtCyrC7J+3ybtiK7ealj28C24P9wdcYaGRSpYuA/qnGeifb//E0i5fhRi6 rXAFRF4imq1Hg2yVqL7aolgiy/1yEdfMnWPWLIm3MQQmSzswfGIfVIdEh1fZvajRnw znhqUroKRUeYfph3R0+0vXOlEx8bYWlB0cQ8yF6AIIrh4KpkAsbL455hgKGylWIMBK QcO0NX/fsV3D64CpJ7E5tpdHE+xRpfSAhTy37M8FddbCtD3yhj34fLQhy/h91DEvbt k5f5lIipqqONjqC+CzE9n9f8Tp6BuRrm+8tQ0Et/EnmpN0kGEiUmzP510OwWK8sON5 5XjJKSmVPQctw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 61996180052 for ; Wed, 6 Aug 2025 12:05:42 +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_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail.gna.ch (darkcity.gna.ch [84.234.28.114]) (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, 6 Aug 2025 12:05:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.gna.ch (Postfix) with ESMTP id 8F3C12381190 for ; Wed, 6 Aug 2025 14:07:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cschneid.com; s=default; t=1754482039; bh=orepQlYWz69Q/pwUAfkF/YCQXq06qKcUH2Bfe75G638=; h=From:Subject:Date:References:To:In-Reply-To; b=pt3jeNW+nlK209/VZtCuxe3kk/vlDjONs9HR7ayKT5iyZRaJhU2TdMEiXm8gNWEVX PehsX8fCsVJEwrh5oPin/4EBTSmEbJL2TBxnEyOHkoXmMBKFTlc1Xitrk15yepSGwK 4MgpXP5yk1VtI0O10DHxudxZJdo2nxjGP1iQuBow= X-Virus-Scanned: amavisd-new at gna.ch Received: from mail.gna.ch ([127.0.0.1]) by localhost (mail.gna.ch [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6K_wZIZbCqnB for ; Wed, 6 Aug 2025 14:07:18 +0200 (CEST) Received: from smtpclient.apple (unknown [194.169.219.181]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail.gna.ch (Postfix) with ESMTPSA id ACA6B238118C for ; Wed, 6 Aug 2025 14:07:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cschneid.com; s=default; t=1754482038; bh=orepQlYWz69Q/pwUAfkF/YCQXq06qKcUH2Bfe75G638=; h=From:Subject:Date:References:To:In-Reply-To; b=B1ZGJjBfhdFm4V6p3tF7Xht+IV3i2+o7z3cQ5r3lspkqGMiE517MKmtMwY6GtNVxa HU1ICQvusQm5FWS8BLWh8yco+rAV3jVXHH7qi9mPsmATOGPiH1VV4lyDr3OVmtTxYs U9Df8tpIQWYTp1nRLNXBCxeQHGgH11KGPI7mRXOg= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Precedence: list list-help: list-post: List-Id: x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: [PHP-DEV] Blog post: If we can get partial generics, should we? Date: Wed, 6 Aug 2025 14:07:18 +0200 References: To: php internals In-Reply-To: Message-ID: <0EDD148D-8AC3-4644-9669-5C32754FED64@cschneid.com> X-Mailer: Apple Mail (2.3826.700.81) From: cschneid@cschneid.com (Christian Schneider) Am 04.08.2025 um 17:23 schrieb Larry Garfield : > Hi folks. I recently wrote a blog post on behalf of the PHP = Foundation about some work Gina has been doing regarding generics. It's = a follow-up to last year's post on a similar topic. We are especially = looking for feedback from the Internals crew, and voters in particular, = on whether or not to proceed. >=20 > https://thephp.foundation/blog/2025/08/05/compile-generics/ To be up-front: I am not the target demographic for this feature, being = an OO and Type minimalist ;-) One little thing I noted in the side-note about type inference = https://thephp.foundation/blog/2025/08/05/compile-generics/#type-inference= was the part > function add(int $x, int $y) > { > return $x + $y; > } >=20 > It's readily obvious that the return type of that function is int, ... Now this is nit-picking but that's not true for PHP in general, if I = give it the values PHP_INT_MAX and 1 the result will be float, not int. It has little to do with the topic of the whole post but I still felt = the urge to point it out. But please do not get into a discussion about = automatic type conversions here because of that, it is just a reminder = that type inference has some edge cases ;-) Regards, - Chris