Hi all. Just one question for clarification:
The RFC states "The new array returned by this function will contain the same values in the same order, but with potentially different keys." But further down it states, that on multiple times the same key the last one will "win". So in that special case it's **not** the same array anymore. Or did I miss something? Cheers Andreas Am 29.05.16 um 15:13 schrieb Colin O'Dell: > Hello everyone, > > I'd like to introduce a new RFC for your consideration and discussion: > https://wiki.php.net/rfc/array_change_keys This would add a new function > named array_change_keys() which simplifies the process of re-keying an > array. > > PHP currently has an array_change_key_case() method, but this only allows > keys to be changed to upper- or lower-case; no method exists to change the > keys to some custom user-defined value. Although it's absolutely possible > to accomplish this without a special function, the alternate approaches > have several drawbacks: > > - Slower execution time compared to the proposed implementation. > - Multiple lines and/or function calls are required. > - Harder to understand the code's purpose with a quick glance. > - The result of a "foreach" approach cannot be passed into another > function without using an intermediate variable. > > A working implementation has been included with the RFC (huge thanks to > Jeremy Mikola for the heavy lifting here!) I've also requested this patch > be added to 3v4l.org; I'll notify everyone if/when that happens. > > I'd greatly appreciate if you could review this RFC and let me know your > thoughts. I'd be happy to answer any questions you might have. > > Regards, > > Colin O'Dell > -- ,,, (o o) +---------------------------------------------------------ooO-(_)-Ooo-+ | Andreas Heigl | | mailto:andr...@heigl.org N 50°22'59.5" E 08°23'58" | | http://andreas.heigl.org http://hei.gl/wiFKy7 | +---------------------------------------------------------------------+ | http://hei.gl/root-ca | +---------------------------------------------------------------------+
smime.p7s
Description: S/MIME Cryptographic Signature