Re: [PHP-DEV] Add is_vectorlike($array) function

2017-05-04 Thread Sara Golemon
On Thu, May 4, 2017 at 5:18 PM, Rowan Collins wrote: > A) arrays that are not vector / list like > B) arrays that have been constructed and manipulated in various ways, such > that they are *now* vector / list like, but aren't packed in memory > C) arrays that have been consistently constructed an

Re: [PHP-DEV] Add is_vectorlike($array) function

2017-05-04 Thread Jesse Schalken
On Fri, May 5, 2017 at 8:18 AM, Rowan Collins wrote: > Maybe I'm misunderstanding what "with holes" means in this case, but I > would have expected any array with holes to trivially return false, here, > because we're looking for arrays with a complete set of consecutive keys. > > That aside, the

[PHP-DEV] NEUTRAL Benchmark Results for PHP Master 2017-05-03

2017-05-04 Thread lp_benchmark_robot
Results for project PHP master, build date 2017-05-03 19:25:59-07:00 commit: 9d6b743 previous commit:043b817 revision date: 2017-05-02 21:48:47-07:00 environment:Haswell-EP cpu:Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB

Re: [PHP-DEV] Add is_vectorlike($array) function

2017-05-04 Thread Rowan Collins
On 04/05/2017 16:52, Sara Golemon wrote: Just want to underline the "is likely to be" part of this sentence. The implementation can't assume an array is not vector-like just because those checks fail. It's possible to manipulate an array into being vector-like, but not packed, or having holes.

Re: [PHP-DEV] Add is_vectorlike($array) function

2017-05-04 Thread Rowan Collins
On 04/05/2017 13:51, Michael Morris wrote: For what it's worth, the Drupal assertion inspector calls these "Strict Arrays" since that's what they are - arrays in the true sense of the term found in all other languages. What PHP is calling an "array" is more accurately a "map" or "hash" I'm not

Re: [PHP-DEV] [RFC] concept: further improvement of filter extension, "generalising" filter definitons while adding new callback filter type

2017-05-04 Thread Dan Ackroyd
On 3 May 2017 at 02:23, Martin "eto" Misuth wrote: > > there is one thing I don't know what to do about, and need your advice. What > about module name clash? I would prefer, for this alternative module, to be > named filter as well IMO that violates the principle of least astonishment - a functi

Re: [PHP-DEV] Add is_vectorlike($array) function

2017-05-04 Thread Sara Golemon
On Tue, May 2, 2017 at 4:13 AM, Jesse Schalken wrote: > The problem is that this function is O(n), but in PHP7 an array that is > vector-like is likely to be packed and without holes (HT_IS_PACKED(x) && > HT_IS_WITHOUT_HOLES(x)), in which case it is known to be vector-like > without needing to ite

Re: [PHP-DEV] Add is_vectorlike($array) function

2017-05-04 Thread Michael Morris
For what it's worth, the Drupal assertion inspector calls these "Strict Arrays" since that's what they are - arrays in the true sense of the term found in all other languages. What PHP is calling an "array" is more accurately a "map" or "hash" There is value in this validation - https://www.drupal

Re: [PHP-DEV] Add is_vectorlike($array) function

2017-05-04 Thread Jesse Schalken
On Tue, May 2, 2017 at 7:55 PM, Rowan Collins wrote: > +1, I've been thinking of making a similar suggestion. We can bikeshed the > name (it should certainly start with "array_"), but I think there's a very > good case for having an optimised implementation built in, given the > opportunities for