Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126355 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 4C1D31A00BC for ; Sat, 8 Feb 2025 18:46:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1739040212; bh=IPA2Oa0BkdLrXZYM7Vynf7caNRf4z7Mx8Dv1ECky6D8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=mJLs4yDQ7nwnxLAOnCOV9pz/a7MrPIK8/SFdl9rvG/mRYYqOeYJfWeIWzZSs7w8WT 308GpGWjVHRS7Ojl/tCQOhP4CoFmGpiFcYd2n757JlLnkdsHvTxYNie8qYzUBe2NEV XPOiGJkprwJd26ikoSGIVv/LyoRC6dCKv1XZ8LG/YE1h8EgXj7IwTTAMqlsyXgGpMT z42xujWaOo6PGU5hb3PDTpK9jOndtph3vh6he8CNCt8XBGTyRNxwaxKbNt43QZtUyx C7soYer8k/j4Kn/TsxONj3GdKvs4+TNtrhgpyfwbD7N5Jy8Y/rX6nj10j4HC+mMOSz lWJbtCWhr6moQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8D942180050 for ; Sat, 8 Feb 2025 18:43:31 +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.2 required=5.0 tests=BAYES_20,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.0 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 ; Sat, 8 Feb 2025 18:43:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1739040373; bh=wT4IurO4WsFb8DOa6Lm2Er+1bpOGqp6NDUWK4IsXYPk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=HVMfra3bliuEmfnlGS9sPDNYe9F8lHtbQ/3QxPX/cPOanUZfOxlzS9qT0GyNVIMJs 5wjKFkeL4gIEjE8gzhrOL9Y1zlFuJpmHu+3gIwOvI45tpiOyfdWL239VaOTXMKTQKC Gt9KI/q9xAZ4akqcgRTT/sOI1OxtjdhOetTgtkM6yYlhpQJUUwHapcFXzucqq+2nLN JVYYIALEG11RrQ4O2511J3F5S7wP1iKiFX9iHedaHzcHja+efl91RK5Y3cyvUnPGFw FBOTMTIuv/Pac0ewc0mG55uOr4RTKFCNHwG5QMEWaI3+Y8X7k4rUfdm8KqxFh9VqK1 4g2a8NOFrxq2Q== Message-ID: <88486267-f5e5-485b-bce1-e30163b5e703@bastelstu.be> Date: Sat, 8 Feb 2025 19:46:12 +0100 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Subject: Re: [PHP-DEV] Introduction - Sam Lewis To: Sam Lewis , Rob Landers Cc: internals@lists.php.net References: <8053193b-0637-4db4-825d-56e7746111dd@bastelstu.be> Content-Language: en-US In-Reply-To: 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 Sam Please do not "top-post" on this mailing list. This means: Please put your reply below the quoted part and ideally also cut the quoted part to the minimum context that you actually want to reply to. You can see how I did this in my first reply to you and also in this reply. On 2/8/25 18:16, Sam Lewis wrote: > That's fair, maybe that will increase the value proposition of the RFC > enough to be worth considering more seriously. A well-designed “Units extension” would certainly be more valuable that adding a few functions without a clear plan / proper API design. But it would probably still be something that would better be solved in userland as a composer library. Unit conversions functions will likely not experience a relevant performance improvement when implemented natively, they are not particularly hard to implement with regard to edge cases so that they would warrant a “well-tested” and “blessed” core implementation and they are unlikely to be so commonly used that they need to *always* be available. Having them in a userland API would also allow them to move more quickly: New units could be added on-demand, rather than being restricted to a once-per-year release cycle. The type of functionality that is nowadays added to PHP’s standard library is “building block” functionality: Functions that a userland developer would commonly need in their custom library or application. The `array_find` functions added in PHP 8.4 are a good example. It's something that every major framework already implements in one way or another, it fits with the existing `array_filter` functionality and it's so generically useful that many libraries benefit from it. The same is true for `Randomizer::getBytesFromString()` added in PHP 8.3. It's also commonly implemented and as it turns out, it is very susceptible to being incorrectly implemented (due to off-by-one errors). For that there's also the existing Randomizer class which a clear API design and scope so that the function fits in nicely with the existing API. Best regards Tim Düsterhus