Re: [RFC] [Discussion] array_match

From: Date: Sun, 23 Aug 2026 14:23:53 +0000
Subject: Re: [RFC] [Discussion] array_match
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-132303@lists.php.net to get a copy of this message
Hi On 8/22/26 17:40, Ayesh Karunaratne wrote:
I'm thumbs down on this for a few reasons. 1. We already have str_contains function. It is more intuitive that a false strpos call, and it makes an array_filter function clean too.
array_filter($values, static fn($value) => str_contains($value, 'foo'));
With PHP 8.6 this could even just be:
    array_filter($values, str_contains(?, 'foo'));
Other than that, I agree with your email entirely. Best regards Tim Düsterhus

« previous php.internals (#132303) next »