[php-src] PR #25845: perf: ext/standard: Avoid int-to-string conversion in array_unique()
| From: | iliaal | Date: | Fri, 27 Nov 2026 17:38:42 +0000 |
| Subject: | [php-src] PR #25845: perf: ext/standard: Avoid int-to-string conversion in array_unique() | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-41128@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25845
Author: iliaal
With the default SORT_STRING flag,
array_unique() converts every integer element to a
temporary string before looking it up. This stores integers as integer keys and, once the first
integer appears, aliases canonical numeric strings to the same keys, which avoids the conversion and
keeps the string comparison semantics. Benchmarks are in the commit message.