Re: [PHP-DEV] Typed array properties V2

2020-01-21 Thread Mike Schinkel
> > On Jan 21, 2020 at 5:37 PM, mailto:rowan.coll...@gmail.com)> > wrote: > > > > On 20/01/2020 00:53, Mike Schinkel wrote: > > One approach mentioned by Andrea Faulds was to extend the hashtable (ref: > > your article[1]) and count types as assigned just like we cu

Re: [PHP-DEV] Adding TypeError and ValueError to count() function

2020-01-21 Thread Nikita Popov
On Tue, Jan 21, 2020 at 9:51 PM Olumide Samson wrote: > Only lazy developers would complain about updating legacy code, perhaps > the code itself is worthless and need not be updated. > > Then, what's the point of pursuing latest features or PHP version when a > individual or a company can't purs

Re: [PHP-DEV] Typed array properties V2

2020-01-21 Thread Rowan Tommins
On 20/01/2020 00:53, Mike Schinkel wrote: One approach mentioned by Andrea Faulds was to extend the hashtable (ref: your article[1]) and count types as assigned just like we currently count references. So a 10,240 element array of ints could have an internal tracker showing that the array con

Re: [PHP-DEV] Typed array properties V2

2020-01-21 Thread Benjamin Morel
> > What if we left the array type alone, and instead focussed on "list" > type and "dict", "dict" types? > That would allow a clear break from previous behaviour, and would allow you > to introduce other changes (e.g. removing string -> int coercion for > numeric string keys). Can't agree mo

Re: [PHP-DEV] Typed array properties V2

2020-01-21 Thread Matthew Brown
> As far as I know, the only viable way to do that is to make the array > intrinsically typed, which means that types are validated when elements are > inserted into the array, not when it is passed across a function boundary. > In other words, array generics. > What if we left the array type alon

Re: [PHP-DEV] Adding TypeError and ValueError to count() function

2020-01-21 Thread Olumide Samson
Only lazy developers would complain about updating legacy code, perhaps the code itself is worthless and need not be updated. Then, what's the point of pursuing latest features or PHP version when a individual or a company can't pursue code upgrade before version update? On Tue, Jan 21, 2020,

Re: [PHP-DEV] Adding TypeError and ValueError to count() function

2020-01-21 Thread Philip Hofstetter
Hi, On Tue, Jan 21, 2020 at 6:17 PM Nikita Popov wrote: > > In the cases you encountered, do you know what type count() was used on? > Was it null? false? Or something else? > > Nikita we were in a similar boat as Björn to the point where we manually patched PHP in production in order to not e

Re: [PHP-DEV] Adding TypeError and ValueError to count() function

2020-01-21 Thread Nikita Popov
On Wed, Jan 8, 2020 at 1:23 PM Björn Larsson wrote: > Den 2020-01-07 kl. 21:57, skrev George Peter Banyard: > > Greetings internals, > > > > I would like your input on adding TypeError and ValueError exceptions > > to the count() function in respect to the Consistent type errors for > > internal