Thanks kindly for the rapid and very helpful feedback. I'm going over it
today and will collate it and think over it further. Given that the
feedback's been so constructive and positive, I'll be getting started on an
RFC over the next day or so.
Matt
--
Kind regards,
*Matthew Setter*
On 09/02/16 02:52, Yasuo Ohgaki wrote:
> Hi,
>
> On Tue, Feb 9, 2016 at 1:03 AM, Kinn Julião wrote:
>> And what's wrong with doing:
>> https://gist.github.com/kinncj/566bbc019be5707b01f2 ?
>
> Perfectly ok to me while it would be slower.
>
> BTW, it's easy and quick to detect
My personal take on this:
Let's add just more 1 function over a 9 function's array API, because I
want to optimize 3 lines in my PHP code, and language lack of Generics
while we still refuse to carefully think about a proper OO Collection API.
Regards,
On Tue, Feb 9, 2016 at 6:19 AM,
guilhermebla...@gmail.com wrote on 09/02/2016 15:41:
My personal take on this:
Let's add just more 1 function over a 9 function's array API, because I
want to optimize 3 lines in my PHP code, and language lack of Generics
while we still refuse to carefully think about a proper OO Collection
On Mon, Feb 8, 2016 at 10:54 AM, Lester Caine wrote:
> On 08/02/16 15:42, Pierre Joye wrote:
> >> I want to propose a new PHP array method, called has_numeric_keys (or
> >> > something similar/better), that would have the following method
> signature:
> >> >
> >> > bool
On Mon, Feb 8, 2016 at 3:32 PM, Matthew Setter wrote:
> I want to propose a new PHP array method, called has_numeric_keys (or
> something similar/better), that would have the following method signature:
>
> bool has_numeric_keys(array $array)
>
> The reason for it is to
On 08/02/16 15:42, Pierre Joye wrote:
>> I want to propose a new PHP array method, called has_numeric_keys (or
>> > something similar/better), that would have the following method signature:
>> >
>> > bool has_numeric_keys(array $array)
> I have no strong opinion on it but I wonder if it should
Matthew Setter wrote on 08/02/2016 14:32:
I want to propose a new PHP array method, called has_numeric_keys (or
something similar/better), that would have the following method signature:
bool has_numeric_keys(array $array)
I like it.
I also suspect it could be implemented very efficiently in
François Laupretre wrote on 08/02/2016 15:44:
For a better consistency, may I suggest a function that would allow to
know whether array keys are all numeric, all strings, or mixed.
Something like array_keys_type() returning one of 3 predefined
constants : ARRAY_KEYS_NUMERIC, ARRAY_KEYS_STRING,
Kinn Julião wrote on 08/02/2016 16:05:
That's the nice thing about userland... you are giving them ability to
implement what they want!
`array_filter([...], 'is_int', ARRAY_FILTER_USE_KEY)` does the job as the
others... don't think having a new function would prevent this.
It does the job, but
On 2/8/16 2:04 PM, Eugene wrote:
> On Mon, Feb 8, 2016 at 3:32 PM, Matthew Setter wrote:
>
>> I want to propose a new PHP array method, called has_numeric_keys (or
>> something similar/better), that would have the following method signature:
>>
>> bool
Hi,
On Tue, Feb 9, 2016 at 1:03 AM, Kinn Julião wrote:
> And what's wrong with doing:
> https://gist.github.com/kinncj/566bbc019be5707b01f2 ?
Perfectly ok to me while it would be slower.
BTW, it's easy and quick to detect array is real array with PHP7.
It would be handy if
Hi,
On Feb 8, 2016 10:00 PM, "Matthew Setter" wrote:
>
> I want to propose a new PHP array method, called has_numeric_keys (or
> something similar/better), that would have the following method signature:
>
> bool has_numeric_keys(array $array)
I have no strong opinion on
I want to propose a new PHP array method, called has_numeric_keys (or
something similar/better), that would have the following method signature:
bool has_numeric_keys(array $array)
The reason for it is to check if the array passed to it only had numeric
keys.
Why this method, when you could do
On 08/02/16 17:36, Markus Fischer wrote:
Hi,
On 08.02.16 18:06, Cesar Rodas wrote:
return array_keys($arr) !== range(0, count($arr) - 1);
`array_keys($array) === range(0, count($array)-1)`
That approach would fall flat when the numeric keys are not consecutive:
$array = [1=>"a", 3=>"b"];
Hi,
I want to propose a new PHP array method, called has_numeric_keys (or
something similar/better), that would have the following method signature:
bool has_numeric_keys(array $array)
The reason for it is to check if the array passed to it only had numeric
keys.
Why this method, when you
On Mon, Feb 8, 2016 at 12:53 PM, Larry Garfield
wrote:
> On 2/8/16 11:46 AM, Kinn Julião wrote:
>
>> On Mon, Feb 8, 2016 at 11:38 AM, Rowan Collins
>> wrote:
>>
>> Kinn Julião wrote on 08/02/2016 16:05:
>>>
>>> That's the nice thing about
Hi,
On 08.02.16 18:06, Cesar Rodas wrote:
>>> return array_keys($arr) !== range(0, count($arr) - 1);
>
> `array_keys($array) === range(0, count($array)-1)`
That approach would fall flat when the numeric keys are not consecutive:
$array = [1=>"a", 3=>"b"];
Disclaimer: AFAIK complete goal of
On Mon, Feb 8, 2016 at 11:38 AM, Rowan Collins
wrote:
> Kinn Julião wrote on 08/02/2016 16:05:
>
>> That's the nice thing about userland... you are giving them ability to
>> implement what they want!
>> `array_filter([...], 'is_int', ARRAY_FILTER_USE_KEY)` does the job
On 2/8/16 11:46 AM, Kinn Julião wrote:
On Mon, Feb 8, 2016 at 11:38 AM, Rowan Collins
wrote:
Kinn Julião wrote on 08/02/2016 16:05:
That's the nice thing about userland... you are giving them ability to
implement what they want!
`array_filter([...], 'is_int',
20 matches
Mail list logo