Re: [RFC] [Discussion] array_match
| From: | سپهر محمودی | Date: | Sun, 23 Aug 2026 14:50:03 +0000 |
| Subject: | Re: [RFC] [Discussion] array_match | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-132305@lists.php.net to get a copy of this message | ||
در تاریخ یکشنبه ۲۳ اوت ۲۰۲۶، ۱۷:۵۸ Tim Düsterhus
<tim@bastelstu.be> نوشت:
> Hi
>
> On 8/22/26 21:31, سپهر محمودی wrote:
> > I have updated the RFC to reflect these changes (Version 0.3):
> > https://wiki.php.net/rfc/array_str_contains
>
> Please keep reusing the same Wiki page for the same RFC and do not
> create a new one when updating the RFC. It is confusing when the link in
> the email of the discussion thread is going to an outdated version of
> the RFC and it also effectively breaks the version history of the Wiki,
> which makes it hard to see what changed in the RFC.
>
> Basically creating a new Wiki page is equivalent to creating a new RFC
> entirely and that means it also needs to have a separate discussion
> thread according to policy.
>
> Best regards
> Tim Düsterhus
>
-------
Hi Tim,
You're absolutely right. The new syntax in PHP 8.6 makes using
array_filter incredibly clean and elegant, and I completely agree on the
readability aspect.
However, my main motivation for this RFC is performance. When dealing with
large arrays, the overhead of executing a callback (even a built-in one)
for every single element in array_filter can be quite significant. A
dedicated function implemented purely in C would bypass that overhead and
execute much faster.
Do you think the performance gain for such a common use-case justifies
having a dedicated function, or do you feel the language should strictly
prefer the array_filter approach despite the overhead?
Best regards,
Sepehr