# Optimizing array_reverse for packed hash tables (when preserve_keys=false)

- Thread: https://externals.io/message/94733
- Original archive: https://news-web.php.net/php.internals/94733
- Started by Benjamin Coutu on 2016-07-28T08:00:00+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #94733 — Benjamin Coutu — 2016-07-28T08:00:00+00:00

URL: https://externals.io/message/94733#94733

Hi Xinchen,

The code I used was simply derived from the code of the array_slice implementation (totally analogous).
Maybe your suggested changes (check HASH_FLAG_PACKED fist + Z_TRY_ADDREF) should be carried over to array_slice then as well.

Please go ahead and commit a patch, I'd prefer to stick to reviewing for now.

Thanks,

Ben
