# Improvements to array.c code base

- Thread: https://externals.io/message/80865
- Original archive: https://news-web.php.net/php.internals/80865
- Started by Benjamin Coutu on 2015-01-20T09:21:43+00:00
- Messages: 1
- RFC: Fast Parameter Parsing API (Implemented (PHP 7.0)) — https://externals.io/rfc/fast_zpp.md
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #80865 — Benjamin Coutu — 2015-01-20T09:21:43+00:00

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

Sorry, your right of course as not preserving keys only applies to numeric indices.

========== Original ==========
From: Xinchen Hui <xinchen.h@zend.com>
To: Benjamin Coutu <ben.coutu@zeyos.com>
Date: Tue, 20 Jan 2015 10:13:04 +0100
Subject: Re: [PHP-DEV] Re: Improvements to array.c code base



Hey:


> Hi,
>
> Regarding ARRAY_SLICE(..., preserve_keys=false) my whole point was that the check for non-numeric key inputs is not necessary if preserve_keys is false.
> It should basically be analogue to `array_values()`, but of course respecting the offset and length boundaries.
I am not sure I understood your point.

even if preserve_keys is false, it still use string key if origin is string key.


>
> One question regarding FAST_ZPP: Why is it not used more often, especially in the satndard libraries? Is there some particular drawback? I'd like to understand.

hmm, https://wiki.php.net/rfc/fast_zpp :)

thanks
>
> Thanks,
>
> Ben
>
> ========== Original ==========
> From: Xinchen Hui <xinchen.h@zend.com>
> To: Benjamin Coutu <ben.coutu@zeyos.com>
> Date: Tue, 20 Jan 2015 09:53:38 +0100
> Subject: [PHP-DEV] Re: Improvements to array.c code base
>
>
>
> Hey:
>
>
> 
> > […]
> This is check for non-numeric key inputs
>
> > […]
> yeah, I will fix it.
> > […]
> hmm, we currently do optimization based on profile against some real
> life apps, like wordpress.
>
> range and array_fill etc doesn't used very common.. so I didn't look into it..
>
> thanks for the advise, I will take a look .
>
> thanks
> > […]
