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

2024-06-27 Thread Stephen Reay
> On 27 Jun 2024, at 13:11, Mike Schinkel wrote: > > >> On Jun 27, 2024, at 12:09 AM, Stephen Reay > > wrote: >> >> Hi Mike, >> >> To answer your question: I believe `abstract static` should be allowed, >> because the "objection" mis-characterises a particul

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

2024-06-27 Thread Mike Schinkel
> > On Jun 27, 2024 at 3:26 AM, mailto:php-li...@koalephant.com)> > wrote: > > > > I think I understand your view: you're not as concerned with consistency if > the alternative is something "better". > > > That yes, but more importantly, that deciding NOT

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

2024-06-27 Thread Rob Landers
On Thu, Jun 27, 2024, at 04:15, Michael Morris wrote: > Hello all. This is a ramble of an idea that's managed to run around my head > for a few days now. It isn't fully formed, but I've ran the thought > experiment as far as I can on my own and want to share it with all of you. > > I've mostly b

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

2024-06-27 Thread Markus Podar
Hi, On 26.06.24 07:18, Mike Schinkel wrote: On Jun 25, 2024, at 4:51 PM, Gina P. Banyard > wrote: On Tuesday, 25 June 2024 at 19:06, Mike Schinkel > wrote: strtok() = strtok() is found 35k times in GitHub: https://github.com/sear

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

2024-06-27 Thread Stephen Reay
> On 27 Jun 2024, at 12:31, Mike Schinkel wrote: > >> On Jun 26, 2024, at 8:14 AM, Gina P. Banyard > > wrote: >> >> >> On Wednesday, 26 June 2024 at 06:18, Mike Schinkel > > wrote: >>> https://3v4l.org/RDYFs#v8.3.8 >>> >>> Note those seve

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

2024-06-27 Thread Rob Landers
On Thu, Jun 27, 2024, at 09:41, Rob Landers wrote: > On Thu, Jun 27, 2024, at 04:15, Michael Morris wrote: >> Hello all. This is a ramble of an idea that's managed to run around my head >> for a few days now. It isn't fully formed, but I've ran the thought >> experiment as far as I can on my own

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

2024-06-27 Thread Kamil Tekiela
On Thu, 27 Jun 2024 at 05:57, Gina P. Banyard wrote: > > On Wednesday, 26 June 2024 at 14:54, Kamil Tekiela > wrote: > > > I think the "Deprecate passing E_USER_ERROR to trigger_error()" should > > be better explained. Why is using this constant a problem? There is a > > link to another RFC, but

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

2024-06-27 Thread Marco Pivetta
Hey Arnaud, On Wed, 26 Jun 2024 at 21:06, Arnaud Le Blanc wrote: > The proposed implementation is adding very little complexity as it's not > adding any special case outside of object handlers (except in json_encode() > and serialize() because these functions trade abstractions for speed). > Fur

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

2024-06-27 Thread Rob Landers
On Thu, Jun 27, 2024, at 12:32, Marco Pivetta wrote: > Hey Arnaud, > > On Wed, 26 Jun 2024 at 21:06, Arnaud Le Blanc wrote: >> The proposed implementation is adding very little complexity as it's not >> adding any special case outside of object handlers (except in json_encode() >> and serialize

Re: [PHP-DEV] Re: [RFC] [Vote] #[\Deprecated] attribute

2024-06-27 Thread Nicolas Grekas
Le mar. 25 juin 2024 à 22:01, Benjamin Außenhofer a écrit : > > > On Mon, Jun 24, 2024 at 5:07 PM Nicolas Grekas < > nicolas.grekas+...@gmail.com> wrote: > >> >> >> Le mer. 5 juin 2024 à 10:18, Benjamin Außenhofer a >> écrit : >> >>> >>> >>> On Wed, May 22, 2024 at 9:22 AM Benjamin Außenhofer >

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

2024-06-27 Thread Arnaud Le Blanc
Hi Marco, Thank you for the very detailed feedback. Please find my answers below. Nicolas will follow-up on some points. On Mon, Jun 24, 2024 at 1:03 AM Marco Pivetta wrote: > * lazy proxies should probably explore replacing object identity further > We have thought about a few approaches for

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

2024-06-27 Thread Arnaud Le Blanc
Hi Rob, On Wed, Jun 26, 2024 at 11:09 PM Rob Landers wrote: > Can you add to the RFC how to proxy final classes as well? This is mentioned > (unless I misunderstood) but in the proxy example it shows the proxy class > extending the proxied class (which I think is an error if the base class is

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

2024-06-27 Thread Arnaud Le Blanc
Hi Marco, On Thu, Jun 27, 2024 at 12:32 PM Marco Pivetta wrote: > > Hey Arnaud, > > On Wed, 26 Jun 2024 at 21:06, Arnaud Le Blanc wrote: >> >> The proposed implementation is adding very little complexity as it's not >> adding any special case outside of object handlers (except in json_encode()

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

2024-06-27 Thread Claude Pache
> Le 27 juin 2024 à 09:41, Rob Landers a écrit : > >> >> PHP User Modules are php files that are brought into the runtime through a >> new parser that is able to generate faster and more concise runtime code by >> removing support for problematic features and imposing a strict mode by >> de

Re: [PHP-DEV] [Early Feedback] Pattern matching

2024-06-27 Thread radar3301
> $p is Point {x: 3, y: $y}; > // If $p->x === 3, bind $p->y to $y and return true. > $p is Point {y: 37, x:@($x)}; > // $p->x === $x && $p->y == 37 I'm just going to put in my $0.02 here and downvote this syntax. I believe that it should be swapped. IMO, `{x: 3, y: $y}` looks too similar to the

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

2024-06-27 Thread Gina P. Banyard
On Thursday, 27 June 2024 at 11:22, Kamil Tekiela wrote: > > Yes, that is a better description. I have updated this section of the RFC. Best regards, Gina P. Banyard

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

2024-06-27 Thread Tim Düsterhus
Hi On 6/26/24 14:14, Gina P. Banyard wrote: Regarding explode($delimiter, $str)[0] — unless it is to be special-cased during compilation —it is a really inefficient way to find the substring up to the first character, especially for large strings and/or when in a tight loop where the explode

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

2024-06-27 Thread Chuck Adams
> On Jun 27, 2024, at 2:22 AM, Stephen Reay wrote: > > I do appreciate that strtok has a kind of bizarre signature/use pattern and > potential for confusion due to how subsequent calls work, but to me that > sounds like a better result for uses that need the repeated call > functionality, would

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

2024-06-27 Thread Tim Düsterhus
Hi On 6/27/24 09:44, Markus Podar wrote: 👎 on deprecating it; if a gotcha with it is not clear (e.g. using it in different scopes, as this was brought up), I see this rather as a "documentation problem". If one can easily use a function incorrectly in a way that is not *immediately* apparent,

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

2024-06-27 Thread Tim Düsterhus
Hi On 6/27/24 19:09, Chuck Adams wrote: Personally I say let strtok be and just admit in the documentation that it’s weird because C. strtok() is not weird because C. It does not rely on the libc strtok() function and did not since at least 1999 (and likely never did): https://github.com/ph

Re: [PHP-DEV] Re: [RFC] [Vote] #[\Deprecated] attribute

2024-06-27 Thread Tim Düsterhus
Hi On 6/27/24 13:10, Nicolas Grekas wrote: That's sad news, because I keep explaining why engine-triggered runtime notices are a terrible idea, yet you're planning to add more of them. The consistency argument Tim wrote in another email isn't sound to me: consistency with a bad idea doesn't make

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

2024-06-27 Thread Deleu
Hi Michael, On Wed, Jun 26, 2024 at 11:21 PM Michael Morris wrote: > Hello all. This is a ramble of an idea that's managed to run around my > head for a few days now. It isn't fully formed, but I've ran the thought > experiment as far as I can on my own and want to share it with all of you. > >

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

2024-06-27 Thread Tim Düsterhus
Hi On 6/24/24 09:53, Ayesh Karunaratne wrote: Personally, I think this will be a useful feature. Just like we have `readonly` properties and `readonly` classes, I don't see why we can't have static methods. I also saw in the draft PR that it does not require a lot of changes to the engine to hav

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

2024-06-27 Thread Tim Düsterhus
Hi On 6/25/24 05:17, Stephen Reay wrote: and I'd rather have the feature with slightly odd syntax rather than not at all. Absolutely not. PHP is already odd enough as it is. We should not add additional oddness in the interest of pushing a new screw-shaped feature in with a sledgehammer. Any

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

2024-06-27 Thread Jordan LeDoux
On Thu, Jun 27, 2024 at 11:13 AM Deleu wrote: > Who would build it is an extremely key aspect of making changes to PHP. > Ideas are hard enough to survive the RFC process when there's already an > implementation. Finding a sponsor to work on this would be the first step. > > ... > I like the ide

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

2024-06-27 Thread Tim Düsterhus
Hi On 6/25/24 10:41, Stephen Reay wrote: Like I said, I much prefer the keyword syntax - but I also recognise that others may have different priorities in terms of supporting older language versions, which is why I think that aspect is worth consideration (perhaps a secondary vote, or an info

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

2024-06-27 Thread Michael Morris
On Thu, Jun 27, 2024 at 2:29 PM Jordan LeDoux wrote: > > > On Thu, Jun 27, 2024 at 11:13 AM Deleu wrote: > >> Who would build it is an extremely key aspect of making changes to PHP. >> Ideas are hard enough to survive the RFC process when there's already an >> implementation. Finding a sponsor t

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

2024-06-27 Thread Michael Morris
On Thu, Jun 27, 2024 at 2:11 PM Deleu wrote: > Who would build it is an extremely key aspect of making changes to PHP. > Ideas are hard enough to survive the RFC process when there's already an > implementation. Finding a sponsor to work on this would be the first step. > Agreed. > > Given tha

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

2024-06-27 Thread Michael Morris
On Thu, Jun 27, 2024 at 1:02 PM MKS Archive wrote: > > Interesting to see this. Serendipitous given the email I sent on the list > in reply to Larry. > > My initial thoughts: > > 1. I really like the concept of cleaning up issues that BC make impossible > to fix by introducing modules. > Thanks.

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

2024-06-27 Thread Richard Miles
Could someone please spare a moment to give me karma so I can open an RFC? I greatly appreciate your time. My username is: wookieetyler Derick Rethans commit inspired me to start looking at the source code in more depth. I got started on this branch

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

2024-06-27 Thread Jim Winstead
On Wed, Jun 26, 2024, at 7:15 PM, Michael Morris wrote: > PHP User Modules are php files that are brought into the runtime through a > new parser that is able to generate faster and more concise runtime code by > removing support for problematic features and imposing a strict mode by > default.

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

2024-06-27 Thread Deleu
On Thu, Jun 27, 2024 at 4:31 PM Michael Morris wrote: > > >> The fact there's weird behaviors as result of trying to import a file and >> suddenly a file all the way from `include_paths` or `php_modules` seems >> like a no-go to me. I'd favor using only simple file path navigation and if >> the f

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

2024-06-27 Thread Levi Morrison
> Is there a reason why traits can't be used to introduce generics? > i.e. extending the code that composes the trait into the class to > replace the generic type? eg. in `zend_add_trait_method`? > (I couldn't quickly find where trait properties get added, even > though my example is for properties

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

2024-06-27 Thread Richard Miles
> 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://github.com/php/php-src/compare/master...morrisonlevi:php-src:parameterized_traits I’m

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

2024-06-27 Thread Rob Landers
On Thu, Jun 27, 2024, at 21:23, Michael Morris wrote: > > On Thu, Jun 27, 2024 at 1:02 PM MKS Archive wrote: >>> >> Interesting to see this. Serendipitous given the email I sent on the list in >> reply to Larry. >> >> My initial thoughts: >> >> 1. I really like the concept of cleaning up issu

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

2024-06-27 Thread Chuck Adams
> On Jun 27, 2024, at 11:26 AM, Tim Düsterhus wrote: > > Hi > > On 6/27/24 19:09, Chuck Adams wrote: >> Personally I say let strtok be and just admit in the documentation that it’s >> weird because C. > > strtok() is not weird because C. It does not rely on the libc strtok() > function and

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

2024-06-27 Thread Michael Morris
On Thu, Jun 27, 2024 at 3:52 PM Jim Winstead wrote: > On Wed, Jun 26, 2024, at 7:15 PM, Michael Morris wrote: > > PHP User Modules are php files that are brought into the runtime through a > new parser that is able to generate faster and more concise runtime code by > removing support for problem

Re: [PHP-DEV] Overriding GMP objects

2024-06-27 Thread Rob Landers
On Thu, Jun 27, 2024, at 05:39, Gina P. Banyard wrote: > On Wednesday, 26 June 2024 at 18:24, Rob Landers wrote: >> Hello internals, >> >> I've had this little library for a while >> (https://github.com/withinboredom/time), mostly as a place to experiment >> with the quirks of PHP and take it i

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

2024-06-27 Thread Jordan LeDoux
On Thu, Jun 27, 2024 at 12:53 PM Jim Winstead wrote: > On Wed, Jun 26, 2024, at 7:15 PM, Michael Morris wrote: > > PHP User Modules are php files that are brought into the runtime through a > new parser that is able to generate faster and more concise runtime code by > removing support for proble

Re: [PHP-DEV] Overriding GMP objects

2024-06-27 Thread Jordan LeDoux
On Thu, Jun 27, 2024 at 2:14 PM Rob Landers wrote: > On Thu, Jun 27, 2024, at 05:39, Gina P. Banyard wrote: > > On Wednesday, 26 June 2024 at 18:24, Rob Landers > wrote: > > Hello internals, > > I've had this little library for a while ( > https://github.com/withinboredom/time), mostly as a plac

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

2024-06-27 Thread Michael Morris
On Thu, Jun 27, 2024 at 4:55 PM Rob Landers wrote: > On Thu, Jun 27, 2024, at 21:23, Michael Morris wrote: > > > On Thu, Jun 27, 2024 at 1:02 PM MKS Archive > wrote: > > > Interesting to see this. Serendipitous given the email I sent on the list > in reply to Larry. > > My initial thoughts: > >

Re: [PHP-DEV] Overriding GMP objects

2024-06-27 Thread Rob Landers
On Thu, Jun 27, 2024, at 06:07, Saki Takamachi wrote: > > I agree with Gina. Being able to change the class of a computed result of an > inherited child class causes several problems. > > The points raised in the `BCMath\Number` discussion can be summarized as > follows. > > - If it is possi

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

2024-06-27 Thread Jim Winstead
On Thu, Jun 27, 2024, at 2:14 PM, Jordan LeDoux wrote: > On Thu, Jun 27, 2024 at 12:53 PM Jim Winstead wrote: >> __ >> On Wed, Jun 26, 2024, at 7:15 PM, Michael Morris wrote: >>> PHP User Modules are php files that are brought into the runtime through a >>> new parser that is able to generate fas

Re: [PHP-DEV] Overriding GMP objects

2024-06-27 Thread Jordan LeDoux
On Thu, Jun 27, 2024 at 2:35 PM Rob Landers wrote: > > > On Thu, Jun 27, 2024, at 06:07, Saki Takamachi wrote: > > > I agree with Gina. Being able to change the class of a computed result of > an inherited child class causes several problems. > > The points raised in the `BCMath\Number` discussio

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

2024-06-27 Thread Jordan LeDoux
On Thu, Jun 27, 2024 at 2:41 PM Jim Winstead wrote: > On Thu, Jun 27, 2024, at 2:14 PM, Jordan LeDoux wrote: > > On Thu, Jun 27, 2024 at 12:53 PM Jim Winstead > wrote: > > > On Wed, Jun 26, 2024, at 7:15 PM, Michael Morris wrote: > > PHP User Modules are php files that are brought into the runti

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

2024-06-27 Thread Rob Landers
On Thu, Jun 27, 2024, at 23:24, Michael Morris wrote: > > > On Thu, Jun 27, 2024 at 4:55 PM Rob Landers wrote: >> __ >> On Thu, Jun 27, 2024, at 21:23, Michael Morris wrote: >>> >>> On Thu, Jun 27, 2024 at 1:02 PM MKS Archive wrote: > Interesting to see this. Serendipitous given th

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

2024-06-27 Thread Rowan Tommins [IMSoP]
On 27/06/2024 03:15, Michael Morris wrote: If you got this far, thank you. This overall idea to take one of the better things to happen to JavaScript in the last decade and incorporate it into PHP has been bothering me for awhile so I figured I'd share.  I don't know how much merit there is to

Re: [PHP-DEV] Overriding GMP objects

2024-06-27 Thread Rob Landers
On Thu, Jun 27, 2024, at 23:46, Jordan LeDoux wrote: > > > On Thu, Jun 27, 2024 at 2:35 PM Rob Landers wrote: >> __ >> >> >> On Thu, Jun 27, 2024, at 06:07, Saki Takamachi wrote: >>> >>> I agree with Gina. Being able to change the class of a computed result of >>> an inherited child class

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

2024-06-27 Thread Lanre
On Thu, Jun 27, 2024 at 1:18 PM Tim Düsterhus wrote: > It should not. See: readonly classes. I also believe that static classes > should be implictly final. Given that no objects of such a class can > exist, they cannot be exchanged by a different class anyways and > inheritance is not meant for

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

2024-06-27 Thread Larry Garfield
On Thu, Jun 27, 2024, at 2:15 AM, Michael Morris wrote: > If you got this far, thank you. This overall idea to take one of the > better things to happen to JavaScript in the last decade and > incorporate it into PHP has been bothering me for awhile so I figured > I'd share. I don't know how mu

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

2024-06-27 Thread Mike Schinkel
This is a long reply rather than send a bunch of shorter emails. > On Jun 27, 2024, at 2:10 PM, Deleu wrote: > > Overall, I think PHP has already reached the limit of surviving with only > PSR-4 and Composer. Single class files were a great solution to get us out of > the nightmare of `require

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

2024-06-27 Thread Mike Schinkel
> On Jun 27, 2024, at 2:11 PM, Tim Düsterhus wrote: > Marking a class as 'static' *does* affect how the class may be used and thus > the static-ness is part of the public API. Therefore it should be a keyword. > Everything else would also be inconsistent with final classes effectively > making

Re: [PHP-DEV] Overriding GMP objects

2024-06-27 Thread Saki Takamachi
Hi Rob, >> On Thu, Jun 27, 2024, at 06:07, Saki Takamachi wrote: >> >> I agree with Gina. Being able to change the class of a computed result of an >> inherited child class causes several problems. >> >> The points raised in the `BCMath\Number` discussion can be summarized as >> follows. >> >

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

2024-06-27 Thread Rowan Tommins [IMSoP]
On 28 June 2024 01:16:24 BST, Mike Schinkel wrote: > It may be an unpopular opinion, but I would argue that namespaces were > optimized for autoloading and the one class/interface per file paradigm I don't see any particular relationship between namespaces and autoloading, or any reason we n