>
> Yes there is:
> array_combine(
> array_map($someFunc, array_keys($arr), $arr),
> $arr
> )
> This way $someFunc gets key as first argument and value as second. (you
> might use array_values($arr) instead of $arr but I’m not sure it’s worth it)
>
Good call! I have updated the RF
Le lundi 30 mai 2016, 01:40:21 Colin O'Dell a écrit :
> Marco,
>
>
> > 1. could you also provide the code for the benchmarks? I'd gladly measure
> > them with an accurate tool
> >
>
> Yeah that would be great! Here's the benchmark I was using:
> https://gist.github.com/colinodell/872c1f0c92351
Marco,
> 1. could you also provide the code for the benchmarks? I'd gladly measure
> them with an accurate tool
>
Yeah that would be great! Here's the benchmark I was using:
https://gist.github.com/colinodell/872c1f0c92351af687347c0c8be4f253
> 2. do we really need another array function tha
A bit skeptic here:
1. could you also provide the code for the benchmarks? I'd gladly measure
them with an accurate tool
2. do we really need another array function that is basically an
`array_combine(array_map($someFunc, array_keys($arr)), $arr)`?
3. and... do we really want another function t
On Tue, May 24, 2016 at 5:37 PM, Nikita Popov wrote:
> On Sun, May 8, 2016 at 5:04 PM, Jakub Zelenka wrote:
>
>> Hi,
>>
>> I have been thinking about it and I would be ok with removing _empty_ in
>> 7.1. That inconsistency is quite annoying and I never liked it. If we can
>> rid of it, that woul
Hello all,
Many getopt implementations expose an `optind` variable to userland
which contains the last argv index examined by the option parser. This
is useful when mixing flag arguments with positional arguments, as it
makes locating the positional arguments easy.
For example, in C and Bash...
>
> 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
> an
>
> shouldn't it be possible to return null as new key? That way you say:
> Use the next free integer index.
>
> Not sure if returning null is wanted (as it could hide errors in the
> callback) or needed in some real world use cases. But it would be more
> in sync with $a[] = ...
>
That's an inter
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 c
Hello,
shouldn't it be possible to return null as new key? That way you say:
Use the next free integer index.
Not sure if returning null is wanted (as it could hide errors in the
callback) or needed in some real world use cases. But it would be more
in sync with $a[] = ...
Regards
Thomas
>
> Does this RFC really require a 2/3 majority? I mean, it does not change
> the syntax or alters anything. It is just about a single new function?
>
> https://wiki.php.net/rfc/voting#required_majority
>
Good catch! You're right, this RFC only adds a single new function and
does not modify the s
On 5/29/2016 3:13 PM, Colin O'Dell wrote:
> 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.
>
+1 from my side, the s
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 t
On 28/05/16 09:06, Lester Caine wrote:
> class Person {
> protected var $death; // var is intentional - my flag for a holder
> $death->__type( DateTime, not_null = false );
>
> To which one can add
> $death->__limit( $birth, '120years' );
> Where $birth now has to be the same type and '120ye
14 matches
Mail list logo