Re: [PHP-DEV] RFC: Add `final class Vector` to PHP

2021-09-16 Thread Pierre Joye
Hello Tyson, Vector support would be very good. JIT can do a lot with them if we have a clean Vector implementation, or even without JIT. What is your base inspiration for Vector? I do like the pretty standard C++ Vector implementation: https://www.cplusplus.com/reference/vector/vector/ Where a

Re: [PHP-DEV] RFC: Add `final class Vector` to PHP

2021-09-16 Thread Matthew Brown
I can also give some in-the-trenches perspective of vec's utility, having spent the last month and a half writing Hack. vec is a really useful data structure to be able to use explicitly in code. It makes code that uses it easier to understand. The main benefit over Vector is that it could be used

Re: [PHP-DEV] RFC: Add `final class Vector` to PHP

2021-09-16 Thread Matthew Brown
On Thu, 16 Sept 2021 at 23:33, tyson andre wrote: > Yeah, as mentioned in > https://wiki.php.net/rfc/vector#adding_a_native_type_instead_is_vec , it > would require a massive amount of work. > > - A standard library for dealing with `vec`, filtering it, etc > - Userland libraries and PECLs would

Re: [PHP-DEV] RFC: Add `final class Vector` to PHP

2021-09-16 Thread Levi Morrison via internals
> > - `contains` also doesn't have a comparator. > > I was considering proposing `->any(callable)` and `->all(callable)` > extensions if this passed. > I'm not quite sure what you mean by a comparator for contains. There'd have > to be a way to check if a raw closure is contained. I mean that th

Re: [PHP-DEV] RFC: Add `final class Vector` to PHP

2021-09-16 Thread tyson andre
Hey Marco Pivetta, > Would it perhaps make sense to drag in php-ds, which has matured quite a bit > over the years? I'm referring to:  > https://www.php.net/manual/en/class.ds-sequence.php > > Is what you are suggesting with `Vector` different from it? > > Note: For some reason, I can't quote y

Re: [PHP-DEV] RFC: Add `final class Vector` to PHP

2021-09-16 Thread tyson andre
Hi Levi Morrison, > I'm okay with a final Vector class in general. I don't love the > proposed API but don't hate it either. Feedback on that at the end. > > What I would _love_ is a `vec` type from hacklang, which is similar to > this but pass-by-value, copy-on-write like an array. Of course, th

[PHP-DEV] Re: Make strtolower/strtoupper just do ASCII

2021-09-16 Thread Tim Starling
On 17/9/21 12:58 pm, Tim Starling wrote: > I would like to know if a patch to make strtolower and strtoupper do > plain ASCII case conversion would be accepted, or if an RFC should be > created. > In case it's unclear, I mean that strtolower() should do 8-bit clean conversion of letters in the 0-

[PHP-DEV] Make strtolower/strtoupper just do ASCII

2021-09-16 Thread Tim Starling
I would like to know if a patch to make strtolower and strtoupper do plain ASCII case conversion would be accepted, or if an RFC should be created. The situation with case conversion is inconsistent. The following functions do ASCII case conversion: strcasecmp, strncasecmp, substr_compare. The f

Re: [PHP-DEV] RFC: Add `final class Vector` to PHP

2021-09-16 Thread Levi Morrison via internals
On Thu, Sep 16, 2021 at 8:10 PM tyson andre wrote: > > Hi internals, > > I've created a new RFC https://wiki.php.net/rfc/vector proposing to add > `final class Vector` to PHP. > > PHP's native `array` type is rare among programming language in that it is > used as an associative map of values, b

Re: [PHP-DEV] RFC: Add `final class Vector` to PHP

2021-09-16 Thread Marco Pivetta
Hey Tyson, Would it perhaps make sense to drag in php-ds, which has matured quite a bit over the years? I'm referring to: https://www.php.net/manual/en/class.ds-sequence.php Is what you are suggesting with `Vector` different from it? Note: For some reason, I can't quote your post and then reply,

[PHP-DEV] RFC: Add `final class Vector` to PHP

2021-09-16 Thread tyson andre
Hi internals, I've created a new RFC https://wiki.php.net/rfc/vector proposing to add `final class Vector` to PHP. PHP's native `array` type is rare among programming language in that it is used as an associative map of values, but also needs to support lists of values. In order to support both

[PHP-DEV] PHP 8.1.0RC2 available for testing

2021-09-16 Thread Patrick ALLAERT
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 PHP 8.1.0RC2 has just been released and may be downloaded from https://downloads.php.net/~patrickallaert/ Or use the git tag: php-8.1.0RC2 Windows binaries are available at: https://windows.php.net/qa/ Please test it carefully, and report any bugs