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
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, Matthew
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*
*Freelanc
Yasuo Ohgaki wrote on 09/02/2016 02:52:
bool is_array(mixed $var [, long $type_of_array]);
where $type_of_array is bit flags such as PHP_ARRAY_REAL,
PHP_ARRAY_HASH, PHP_ARRAY, PHP_ARRAY_RECLUSIVE, etc.
I like this variant (although I don't like the term "real"). Unlike
returning the type, it'
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 array is real arra
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 kind of array can be
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 userland... you are giving them ability to
implement
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', ARRAY_FILTER_USE_KEY)` does the
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"];
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 as the
>> others... don't t
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 coul
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 the
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 has_numeric_keys(array $array)
>>
>> The r
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 check if the array passed
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
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,
Le 08/02/2016 15:32, Matthew Setter a écrit :
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 num
On Mon, Feb 8, 2016 at 9:32 AM, 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 check if the array passed
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 has_numeric_keys(array $ar
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 hav
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
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 it but I wonder if it sh
22 matches
Mail list logo