[php-src] PR #25846: perf: ext/standard: Skip empty inputs and optimize packed src in array_merge()
| From: | iliaal | Date: | Fri, 27 Nov 2026 17:40:07 +0000 |
| Subject: | [php-src] PR #25846: perf: ext/standard: Skip empty inputs and optimize packed src in array_merge() | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-41129@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25846
Author: iliaal
array_merge() copies its first argument even when it is empty, so a leading
[] sends the following packed arrays through hash insertion. This starts from the first
non-empty argument and skips empty ones. A temporary is still reused in place only when it is the
first argument, because in-place reuse keeps a stale next free index (GH-24404). Benchmarks are in
the commit message.