Re: [PHP-DEV] [Initial Feedback] Typed Arrays

2024-06-30 Thread Rob Landers
On Mon, Jul 1, 2024, at 05:05, Richard Miles wrote: > Howdy Stephen, > >>> >>> >>> It seems like everyone always gets really hung up on generics! That or how >>> to syntactically implement this. >> >> Hi >> >> Given other improvements in the language, I don't really see much need for >> t

Re: [PHP-DEV] [Initial Feedback] Typed Arrays

2024-06-30 Thread Rob Landers
On Mon, Jul 1, 2024, at 02:59, Larry Garfield wrote: > On Sun, Jun 30, 2024, at 11:13 AM, Michał Marcin Brzuchalski wrote: > > Hi Richard, > > > > czw., 27 cze 2024, 22:33 użytkownik Richard Miles > > napisał: > >> > >> > I worked with Joe Watkins to do a proof-of-concept for generic traits. > >

Re: [PHP-DEV] [Initial Feedback] Typed Arrays

2024-06-30 Thread Stephen Reay
> On 1 Jul 2024, at 10:05, Richard Miles wrote: > > Howdy Stephen, > >>> It seems like everyone always gets really hung up on generics! That or how >>> to syntactically implement this. >> >> Hi >> >> Given other improvements in the language, I don't really see much need for >> the ability

Re: [PHP-DEV] Packages Iteration 3: was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript

2024-06-30 Thread Michał Marcin Brzuchalski
Hi Michael, pon., 1 lip 2024 o 01:18 Michael Morris napisał(a): > ... > Applications > > The application is the root package. It is the package that imports to the > root namespace. When PHP is asked to parse a file it will look for a > `.php-packages` folder, first in the current working direct

Re: [PHP-DEV] [Initial Feedback] Typed Arrays

2024-06-30 Thread Michał Marcin Brzuchalski
pon., 1 lip 2024 o 03:01 Larry Garfield napisał(a): > On Sun, Jun 30, 2024, at 11:13 AM, Michał Marcin Brzuchalski wrote: > > Hi Richard, > > > > czw., 27 cze 2024, 22:33 użytkownik Richard Miles > > napisał: > >> > >> > I worked with Joe Watkins to do a proof-of-concept for generic traits. > >>

Re: [PHP-DEV] [Initial Feedback] Typed Arrays

2024-06-30 Thread Richard Miles
Howdy Stephen, >> It seems like everyone always gets really hung up on generics! That or how >> to syntactically implement this. > > Hi > > Given other improvements in the language, I don't really see much need for > the ability to specify fixed keys and their types (ie associative arrays) (I

Re: [PHP-DEV] [Initial Feedback] Typed Arrays

2024-06-30 Thread Stephen Reay
Sent from my iPhoneOn 1 Jul 2024, at 09:03, Richard Miles wrote:There even was an RFC in voting which Joe implemented and it addresses nearly what is discussed it this thread https://wiki.php.net/rfc/arrayof The link above has broken page links to the mailing list. I’ve found the externals.io hi

Re: [PHP-DEV] Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript)

2024-06-30 Thread Mike Schinkel
> On Jun 30, 2024, at 5:18 PM, Rob Landers wrote: > I think composer and friends are a moot point. If we go a bespoke way for > everything, we end up with a mess. What about creating "hooks" that things > like composer can "register" an installer at? For example, we could define a > "WELL_KNOWN

Re: [PHP-DEV] Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript)

2024-06-30 Thread Mike Schinkel
> On Jun 30, 2024, at 4:28 PM, Michael Morris wrote: > > So let's take another crack at this based on all the points raised in the > thread. This should also underline why I don't consider this an RFC - I am > iterating until we arrive at something that may be refinable into an RFC. And > I sa

Re: [PHP-DEV] [RFC] Static class

2024-06-30 Thread Mike Schinkel
> On Jun 30, 2024, at 11:10 AM, Tim Düsterhus wrote: > I strongly favor an opinionated RFC where the RFC author did their research > and makes it clear why the proposal is the right choice and backs this up by > proper arguments. Of course this doesn't mean that the RFC author should not > list

Re: [PHP-DEV] [Initial Feedback] Typed Arrays

2024-06-30 Thread Richard Miles
> There even was an RFC in voting which Joe implemented and it addresses nearly > what is discussed it this thread https://wiki.php.net/rfc/arrayof The link above has broken page links to the mailing list. I’ve found the externals.io history and have given it a read: htt

Re: [PHP-DEV] [Initial Feedback] Typed Arrays

2024-06-30 Thread Larry Garfield
On Sun, Jun 30, 2024, at 11:13 AM, Michał Marcin Brzuchalski wrote: > Hi Richard, > > czw., 27 cze 2024, 22:33 użytkownik Richard Miles > napisał: >> >> > I worked with Joe Watkins to do a proof-of-concept for generic traits. >> > It's a bit old since it's from 2017, but could be a useful starti

Re: [PHP-DEV] [RFC] [Discussion] Add bcdivmod to BCMath

2024-06-30 Thread Saki Takamachi
Hi Larry, > I agree an associative array is the second-worst option. An inout by-ref > argument is the absolute worst. > > Normally my default position is that when in doubt, make it a structured > object with properly defined properties, and screw whatever micro-performance > hit it is, you

[PHP-DEV] Packages Iteration 3: was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript

2024-06-30 Thread Michael Morris
First off, in 10 years of using gmail I've never had it lose an email. Well, it happened after I spent 4 hours on this. So, this is sorta iteration 4. I'll type this up in Visual Studio code and then paste to gmail. The Wordpress discussion about composer and the decision not to use it keys in t

Re: [PHP-DEV] [Initial Feedback] Typed Arrays

2024-06-30 Thread Richard Miles
>> If I were to choose between typed-array and collection like Derick showed a >> little bit I'd choose typed arrays definitely as a first feature to be >> merged into PHP. Cheers indeed. I’m still looking for a karma sponsor ;) > Tuples are nice because they are bounded, they can probably act

Re: [PHP-DEV] Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript)

2024-06-30 Thread Rob Landers
On Sun, Jun 30, 2024, at 22:28, Michael Morris wrote: > So let's take another crack at this based on all the points raised in the > thread. This should also underline why I don't consider this an RFC - I am > iterating until we arrive at something that may be refinable into an RFC. And > I say

[PHP-DEV] Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript)

2024-06-30 Thread Michael Morris
So let's take another crack at this based on all the points raised in the thread. This should also underline why I don't consider this an RFC - I am iterating until we arrive at something that may be refinable into an RFC. And I say we because without the aid of those in this conversation I would n

Re: [PHP-DEV] [Initial Feedback] Typed Arrays

2024-06-30 Thread Rob Landers
On Sun, Jun 30, 2024, at 18:13, Michał Marcin Brzuchalski wrote: > Hi Richard, > > czw., 27 cze 2024, 22:33 użytkownik Richard Miles > napisał: >> >> > I worked with Joe Watkins to do a proof-of-concept for generic traits. >> > It's a bit old since it's from 2017, but could be a useful starti

Re: [PHP-DEV] [Initial Feedback] Typed Arrays

2024-06-30 Thread Michał Marcin Brzuchalski
Hi Richard, czw., 27 cze 2024, 22:33 użytkownik Richard Miles napisał: > > > I worked with Joe Watkins to do a proof-of-concept for generic traits. > > It's a bit old since it's from 2017, but could be a useful starting > > point if you are serious about pursuing this idea: > > > > > https://git

Re: [PHP-DEV] [RFC] [Discussion] Add bcdivmod to BCMath

2024-06-30 Thread Rob Landers
On Sun, Jun 30, 2024, at 17:45, Tim Düsterhus wrote: > Hi > > On 6/30/24 17:31, Rob Landers wrote: > > - list() -- kinda > > That is not a function. > > > - array_shift(), array_pop(), etc. > > These do not return by out-parameter. These return the value and modify > the array by reference to

Re: [PHP-DEV] [RFC] [Discussion] Add bcdivmod to BCMath

2024-06-30 Thread Tim Düsterhus
Hi On 6/30/24 17:31, Rob Landers wrote: - list() -- kinda That is not a function. - array_shift(), array_pop(), etc. These do not return by out-parameter. These return the value and modify the array by reference to remove the returned value. - preg_match*() These only return suppleme

Re: [PHP-DEV] [RFC] [Discussion] Add bcdivmod to BCMath

2024-06-30 Thread Larry Garfield
On Sun, Jun 30, 2024, at 10:11 AM, Saki Takamachi wrote: > Hi, > >>> Just a suggestion: what about making the returned array an associative >>> array ? Like so: >>> ``` >>> array( >>> 'quotient' => 61, >>> 'remainder' => 1, >>> ); >>> ``` >>> This would remove the need for devs to remembe

Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript

2024-06-30 Thread Michael Morris
I have no proposal. I'm brainstorming. Please don't step out of this conversation as it has been enormously helpful. On Sun, Jun 30, 2024 at 2:48 AM Mike Schinkel wrote: > > On Jun 29, 2024, at 10:57 AM, Michael Morris wrote: > > On Sat, Jun 29, 2024 at 5:40 AM Mike Schinkel > wrote: > >> Howe

Re: [PHP-DEV] [RFC] [Discussion] Add bcdivmod to BCMath

2024-06-30 Thread Rob Landers
On Sun, Jun 30, 2024, at 17:11, Saki Takamachi wrote: > Hi, > > >> Just a suggestion: what about making the returned array an associative > >> array ? Like so: > >> ``` > >> array( > >> 'quotient' => 61, > >> 'remainder' => 1, > >> ); > >> ``` > >> This would remove the need for devs t

Re: [PHP-DEV] [RFC] [Discussion] Add bcdivmod to BCMath

2024-06-30 Thread Saki Takamachi
Hi, >> Just a suggestion: what about making the returned array an associative >> array ? Like so: >> ``` >> array( >> 'quotient' => 61, >> 'remainder' => 1, >> ); >> ``` >> This would remove the need for devs to remember the order of the return >> values and would make the return value s

Re: [PHP-DEV] [RFC] Static class

2024-06-30 Thread Tim Düsterhus
Hi On 6/28/24 21:29, Bilge wrote: I'm already leaning towards "Don't want static classes" Why? It is important to understand what your misgiving are in case there anything we can do to assuage them. I don't see value in being able to explicitly mark a class as `static` for the reasons that

[PHP-DEV] [RFC] [Discussion] Fix up BCMath Number Class / Change GMP bool cast behavior

2024-06-30 Thread Saki Takamachi
Hi internals, Created a follow-up RFC for the BCMath\Number class. This RFC also contains proposed changes to GMP's bool cast. I have proposed similar changes to BCMath, so for procedural efficiency I have combined them into the same RFC. Note that although they are combined into one RFC, these

Re: [PHP-DEV] [RFC] Lazy Objects

2024-06-30 Thread Rob Landers
I just noticed in the RFC that I don't see any mention of what happens when running `get_class`, `get_debug_type`, etc., on the proxies, but it does mention var_dump.

Re: [PHP-DEV] [RFC][Discussion] Enhance JSON error messages

2024-06-30 Thread juan carlos morales
El El dom, 30 de jun. de 2024 a la(s) 11:15, Tim Düsterhus escribió: > Hi > > On 6/30/24 15:43, juan carlos morales wrote: > > So, what I see here in my shortexperiencie is an RFC with 3 Options > > That is not an option. Each RFC needs a clear primary vote that is a > "Yes/No" vote. > > > 1) Enh

Re: [PHP-DEV] [RFC] [Discussion] Add bcdivmod to BCMath

2024-06-30 Thread Rob Landers
On Sun, Jun 30, 2024, at 16:16, Juliette Reinders Folmer wrote: > On 30-6-2024 16:04, Saki Takamachi wrote: >> Hi internals, >> >> I created an RFC and put it in discussion status. >> https://wiki.php.net/rfc/add_bcdivmod_to_bcmath >> >> I expect return values will probably be the main topic of d

Re: [PHP-DEV] [RFC] [Discussion] Add WHATWG compliant URL parsing API

2024-06-30 Thread Larry Garfield
On Sun, Jun 30, 2024, at 1:00 AM, Máté Kocsis wrote: >> It mirrors the interface, but it can’t be swapped out for a UriInterface >> instance, especially since it can’t be extended, so I wouldn’t consider it >> compatible. I would still need to write a compatibility layer that composes >> Url\Url

Re: [PHP-DEV] [RFC] Static class

2024-06-30 Thread Tim Düsterhus
Hi On 6/29/24 17:56, Bilge wrote: - Why is it a class-level flag and not an attribute (similar to the `#[Override]` attribute in PHP 8.3) ? I believe Tim already answered this, and I understood his reasoning to be that keywords are used when they modify behaviour in a way that is meaningful

Re: [PHP-DEV] [RFC] [Discussion] Add bcdivmod to BCMath

2024-06-30 Thread Tim Düsterhus
Hi On 6/30/24 16:16, Juliette Reinders Folmer wrote: Just a suggestion: what about making the returned array an associative array ? Like so: ``` array( 'quotient' => 61, 'remainder' => 1, ); ``` This would remove the need for devs to remember the order of the return values and would

Re: [PHP-DEV] [RFC] [Discussion] Add bcdivmod to BCMath

2024-06-30 Thread Juliette Reinders Folmer
On 30-6-2024 16:04, Saki Takamachi wrote: Hi internals, I created an RFC and put it in discussion status. https://wiki.php.net/rfc/add_bcdivmod_to_bcmath I expect return values ​​will probably be the main topic of discussion. Regards, Saki Just a suggestion: what about making the returned a

Re: [PHP-DEV] [RFC][Discussion] Enhance JSON error messages

2024-06-30 Thread Tim Düsterhus
Hi On 6/30/24 15:43, juan carlos morales wrote: So, what I see here in my shortexperiencie is an RFC with 3 Options That is not an option. Each RFC needs a clear primary vote that is a "Yes/No" vote. 1) Enhance the error message we already have 2) keep json_last_error_msg as it is and add

[PHP-DEV] [RFC] [Discussion] Add bcdivmod to BCMath

2024-06-30 Thread Saki Takamachi
Hi internals, I created an RFC and put it in discussion status. https://wiki.php.net/rfc/add_bcdivmod_to_bcmath I expect return values ​​will probably be the main topic of discussion. Regards, Saki

Re: [PHP-DEV] [RFC] Lazy Objects

2024-06-30 Thread Tim Düsterhus
Hi On 6/27/24 16:27, Arnaud Le Blanc wrote: * flags should be a `list` instead. A bitmask for a new API feels unsafe and anachronistic, given the tiny performance hit. Unfortunately this leads to a 30% slowdown in newLazyGhost() when switching to an array of enums, in a micro benchmark. I'm

Re: [PHP-DEV] [RFC][Discussion] Enhance JSON error messages

2024-06-30 Thread juan carlos morales
El El dom, 30 de jun. de 2024 a la(s) 09:02, Tim Düsterhus escribió: > Hi > > On 6/28/24 15:49, juan carlos morales wrote: > > Suggested by Jakub Zelenka (the main arquitect of the JSON part in php > > basically), in the PULL REQUEST is better to create a brand new > > function to have detailed e

Re: [PHP-DEV] [RFC] Lazy Objects

2024-06-30 Thread Tim Düsterhus
Hi On 6/30/24 15:08, Tim Düsterhus wrote: I've read the updated RFC and it's still not clear to me that returning an arbitrary “actual instance” object is sound. Especially when private properties - which for all intents and purposes are not visible outside of the class - are involved. Consider

Re: [PHP-DEV] [RFC] Lazy Objects

2024-06-30 Thread Tim Düsterhus
Hi On 6/22/24 00:22, Benjamin Außenhofer wrote: Given the complexities of newLazy* already, i am just trying to find arguments to keep the public surface of this API as small as posisble, as its intricacies are hard to grasp and simplicity / less ways to use it will be a benefit. So far i don't

Re: [PHP-DEV] [RFC] Lazy Objects

2024-06-30 Thread Tim Düsterhus
Hi I finally got around to giving the RFC another read. Please apologize if this email asks questions that have already been answered elsewhere, as the current mailing list volume makes it hard for me to keep up. On 6/14/24 14:13, Arnaud Le Blanc wrote: Is there any reason to call the makeLa

Re: [PHP-DEV] [RFC] [discussion] Correctly name the rounding mode and make it an Enum

2024-06-30 Thread Tim Düsterhus
Hi On 6/24/24 22:11, Jordan LeDoux wrote: If there is ONE improvement to be made with this RFC, it is to completely remove "up" and "down" from the rounding terminology. Please note that the RFC does not include the “Up” and “Down” terminology in its proposal. It only uses it to describe whic

Re: [PHP-DEV] [RFC][Discussion] Enhance JSON error messages

2024-06-30 Thread Tim Düsterhus
Hi On 6/28/24 15:49, juan carlos morales wrote: Suggested by Jakub Zelenka (the main arquitect of the JSON part in php basically), in the PULL REQUEST is better to create a brand new function to have detailed error messages when json encoding, decoding, validating, fails. For the folks followi

Re: [PHP-DEV] [RFC] Deprecations for PHP 8.4

2024-06-30 Thread Tim Düsterhus
Hi On 6/29/24 23:23, mickmackusa wrote: If one can easily use a function incorrectly in a way that is not *immediately* apparent, then I consider the function to be badly designed. Does that philosophy also cover preg_quote()? I've lost count of the Yes, it does. Would it be reasonable

Re: [PHP-DEV] [RFC] Operator Overrides -- Lite Edition

2024-06-30 Thread Rob Landers
On Sun, Jun 30, 2024, at 13:37, Saki Takamachi wrote: > > Hi, > >> On Sun, Jun 30, 2024, at 13:05, Saki Takamachi wrote: >>> >>> Hi, >>> > I'm not sure. Does this mean that such "hack" is unavoidable? > > And I don't really understand what "pointless hack" means. This would

Re: [PHP-DEV] Bumping minimum Apache version to 2.4

2024-06-30 Thread Niels Dossche
On 30/06/2024 00:58, Peter Kokot wrote: > Hello, > > Perhaps you're not aware that the PHP build system currently still > supports building apache2handler SAPI for Apache 2.0 and 2.2 branches. > Apache 2.2 has been marked as EOL in December 2017 and doesn't receive > security patches. Also, most L

Re: [PHP-DEV] [RFC] Operator Overrides -- Lite Edition

2024-06-30 Thread Saki Takamachi
Hi, >> On Sun, Jun 30, 2024, at 13:05, Saki Takamachi wrote: >> >> Hi, >> I'm not sure. Does this mean that such "hack" is unavoidable? And I don't really understand what "pointless hack" means. This would make sense if operator overloading was already allowed, but it isn't

Re: [PHP-DEV] [RFC] Operator Overrides -- Lite Edition

2024-06-30 Thread Rob Landers
On Sun, Jun 30, 2024, at 13:05, Saki Takamachi wrote: > > Hi, > >>> I'm not sure. Does this mean that such "hack" is unavoidable? >>> >>> And I don't really understand what "pointless hack" means. This would make >>> sense if operator overloading was already allowed, but it isn't. >> >> Not

Re: [PHP-DEV] [RFC] Operator Overrides -- Lite Edition

2024-06-30 Thread Saki Takamachi
Hi, >> I'm not sure. Does this mean that such "hack" is unavoidable? >> >> And I don't really understand what "pointless hack" means. This would make >> sense if operator overloading was already allowed, but it isn't. > > Not unavoidable, but pointless. For example, I attempted to create a Stri

Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript

2024-06-30 Thread Rowan Tommins [IMSoP]
On 29 June 2024 21:20:23 BST, Michael Morris wrote: >Composer is wonderful as a userland solution to a problem the Internals >team has failed to solve, but such a critical problem as package >management being mostly solved in userland I don't think anyone failed to solve anything. Somebody ca

Re: [PHP-DEV] [RFC] Operator Overrides -- Lite Edition

2024-06-30 Thread Rob Landers
On Sun, Jun 30, 2024, at 09:31, Saki Takamachi wrote: > Hi, > > >> It seems like the "hack" I mentioned is still possible, am I > >> misunderstanding something? > > > > That’s always going to be a possibility, no matter what we do or how we do > > it. I think it would be a rather pointless ha

Re: [PHP-DEV] [RFC] Operator Overrides -- Lite Edition

2024-06-30 Thread Saki Takamachi
Hi, >> It seems like the "hack" I mentioned is still possible, am I >> misunderstanding something? > > That’s always going to be a possibility, no matter what we do or how we do > it. I think it would be a rather pointless hack now that I can run the code. > For the most part, the engine treat

Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript

2024-06-30 Thread Rob Landers
On Sun, Jun 30, 2024, at 08:40, Mike Schinkel wrote: > > On Jun 29, 2024, at 9:15 AM, Rob Landers wrote: > > On Sat, Jun 29, 2024, at 13:43, Mike Schinkel wrote: > >>> On Jun 29, 2024, at 7:14 AM, Rob Landers wrote: > You say it is impractical, you claim millions of users, but you don't > >

Re: [PHP-DEV] [RFC] [Discussion] Add WHATWG compliant URL parsing API

2024-06-30 Thread ignace nyamagana butera
On 29/06/2024 11:57, Stephen Reay wrote: On 29 Jun 2024, at 04:48, Niels Dossche wrote: - It's a bit of a shame that the PSR interface treats queries as strings. In Javascript we have the URLSearchParams class that we can use as a key-value storage for query parameters. This Javascript clas