Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123275 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 B16F81A009C for ; Tue, 7 May 2024 18:32:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1715106799; bh=ucmsG9DKgOPQENOia8MW+FtjI2b+bYZgkUpigoLkzzs=; h=Date:Subject:To:References:From:In-Reply-To:From; b=Hf4kD37pxPihBiEphrJHNgBOJpmBRVABZUT5ERB/ESCxUjhI86FSmPEPXYXla8CxX op39OFpsDwstO0yTrMfDAgNp2bZ3rABKUDX7vuuX72R+g4Xu8YNiByIoHYrsqSs5hv QHkXwb354+jX6yY3fBJiKNRBhCQLf3rWXKiCuJTv9Eu8Jv9V+fknYu7F1z0SoR2SCf gfGz6E6EtX6w6q3R9IbT75n669gAVRBZWpBS2sfl5XPIJAM35OoTWsB4CmvhlRTAZy kwTbcyvTGn7Dtgrf0eJFgstH28U3VBv6pgmIcUTeJJhwHsmdSUwWDkLJQxzm6JLXZo eTwcs/nydvfDg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CC3EB1801D4 for ; Tue, 7 May 2024 18:33:18 +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,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 7 May 2024 18:33:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1715106749; bh=gQNP8cFHKeXFhOizyY0FkrSF19WMi6dFpx1rDWAT4pI=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=mnSZuG4YFdMNVG9jap/gSry6FtyJi29qOIFM/qj2+kbhEfUrWtpuXuG0evHaMeyFK xZ/Xh7YicUakvdNIXnZL9yOKzKlSnVk7fIOLAC/LJWvm7qq4jTD9R5Ar77Abiwn6rU bXhbEIDDq9i4mHbfDfusjleStOpoIWEdw9+Cz7jEb31wVMLJ3oq07pn8bC0/9R91jX DQrWpBi2tAaeEYmWi2X32cOWfUCx+3VouCKvFtoM3kxj9HUQg5HByOdhaMScud1PcN 2y2Zs6M6kNurUMZ0pglr4RDTgOSX1LzB+3maeqRU6RN42yog3eC/UqPZjU67Pk8dt8 hd5KeVvYmc52w== Message-ID: <59d9c213-e159-420f-821c-46a6325f943d@bastelstu.be> Date: Tue, 7 May 2024 20:32:29 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Subject: Re: [PHP-DEV] RFC [Discussion]: array_find To: =?UTF-8?Q?Joshua_R=C3=BCsweg?= , PHP internals References: <24e4529d-0b75-44de-90ef-34de5dfb1c99@wcflabs.de> <278889be-82ab-4827-a9e7-801b5ba2d8f8@app.fastmail.com> <06373f2b-5de0-4582-96c5-29c3b474c01d@wcflabs.de> <45e6365b-4963-4969-8cc1-80bae6922fc8@wcflabs.de> <60bb55a5-16c9-4df0-8521-75f82d3dbf5b@app.fastmail.com> <41ad56d9-8b27-420e-ba85-a3e9a6122bcf@wcflabs.de> <7a77288e-ddb7-436e-8981-b8b2508e1547@app.fastmail.com> <49aa8581-ed2e-4aa3-b330-7cd5d8efa764@wcflabs.de> Content-Language: en-US In-Reply-To: <49aa8581-ed2e-4aa3-b330-7cd5d8efa764@wcflabs.de> 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 On 5/6/24 20:44, Joshua Rüsweg wrote: > I don't think that any internal functions are realistically passed > there, but rather user-defined ones. I would therefore not make the > function any more complicated than it already is. If the function works > differently with internal functions than with user functions, this can > also be very confusing for users. > > [...] To have another non-RFC-author opinion on the record: I agree here. Making the proposed functions detect the signature of the passed callback would *add* to the inconsistency, rather than removing from it. They would be the only functions doing that. I'd rather see this fixed properly by making the behavior of internal and userland functions consistent when facing superfluous parameters (with a preference for the stricter behavior of internal functions), as has been discussed in the ML thread that Joshua linked. I'm in favor of the RFC and implementation the way it currently looks like. Implementation just needs some additional test cases, e.g. to ensure the callback is not called after an item has been found and to ensure proper behavior when an Exception is thrown. Best regards Tim Düsterhus