Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128579 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 51F9F1A00BC for ; Thu, 28 Aug 2025 07:30:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1756366110; bh=SV677qsqwnY44tjsSMSCakLEFj3tSfleatBJ1dOKiCo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=MVENhvR7ua4SYWGy/UDAkjty3F0kWsPKB8mZW7mPLO75WYwczB3cfl3PRCbvcAouh 5lWcihVlzziughhIbnogN/U5c+7y1NB29eWpAwr09aOEPNvtdbI+McUEORXTzdM7bI APeQImYjU2LPyYgRvo1obPUzhhFB91mHkDvMrOOEq35VpVsqmxE3Dr2B8JVix7xsbM JB8gaM4uemmglP0IA020anS+CJrycwT3f2P683BNchW/MOVr83RzseUuHVs3N4fSq6 3ZiouJC8l7hNx/JO06KFtjaBrpp/RSNRL2XLSNr7GBWIfv+vRNLK9IZYbKMcwO49OK qvzgw95GXiuGw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 40CD6180032 for ; Thu, 28 Aug 2025 07:28:29 +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.7 required=5.0 tests=BAYES_05,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 chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (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, 28 Aug 2025 07:28:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1756366198; bh=nq+O8WWXSX0VB86T2IH+RgFwdAq97Fj08LmVd/9ZbnA=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=kLqMaAQE1b0Li/F8DUjGYi6o/wzSx464Lqc9APkwGrc9fnK4Foh9pCgycywDtX13L h+rLtzCXqON4vy/d7LPLXtWDqNcVM6/0qQnQiouxAVavK7iILS4xyvwnwgMRUtmEN2 qetTYADctL78HnKERXZ1DG6VkWPAPFEvK9ifcssrfaUAFwvOQ/8ofY/Rf5YQndX/r4 5bL+dNf7if+3t7rmoKX9ny2rl5mH4294i6QjXgGcXHDyfHcJq5Qnd10VUQhCrALHSr TeqN3SvkTwx7HdZyO0TF2NV69Gr6R61TB8e9gbXE5NLeXsmd9WgkGuUbx4eu+1dX6F CLKFHMyWITzTQ== Precedence: list list-help: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Date: Thu, 28 Aug 2025 09:29:58 +0200 To: Marco Pivetta Cc: Kyle Katarn , PHP Internals Subject: Re: [PHP-DEV] [RFC] [Discussion] Add clamp function In-Reply-To: References: Message-ID: <3314b2f7e74a45a45c3c6626fd0159e9@bastelstu.be> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi Am 2025-08-27 17:45, schrieb Marco Pivetta: > I know this isn't very used in internals, but does it make sense to > write > generics for the generated stubs of this function? The stub generator makes use of the types provided in the PHPDoc comment to generate optimizer information. The stub generator has no support for generic types (or things like array shapes), which makes this risky. The information is not used, it is not tested and it might confuse the stub generator. See https://github.com/php/php-src/pull/19546 as an example. If there is an interest in having generics in the stubs, the stub generator should first be extended to handle them, even if it does not (yet) use the information and then it should be consistently applied to the entirety of PHP's stdlib. Best regards Tim Düsterhus