Re: [PHP-DEV] Concept: constructor overloading syntax sugar

2025-02-18 Thread Larry Garfield
On Tue, Feb 18, 2025, at 2:00 AM, Rowan Tommins [IMSoP] wrote: > On 17 February 2025 14:39:42 GMT, Viktor Khramov > wrote: >>Hi! >> >>The point is here: >>https://gist.github.com/vhood/665418835e65be26d5a818fded92ab75 > > >>Static functions look awful and break the object's API. > > Personally, I

Re: [PHP-DEV] Fully overridable factory methods

2025-02-18 Thread Rob Landers
On Tue, Feb 18, 2025, at 17:52, Juris Evertovskis wrote: > Hi, > > A recent discussion brought up the need for multiple constructors for the > same class. > https://externals.io/message/126428 > > The need was mostly answered by suggestions to use factory methods. > However on an earlier dis

Re: [PHP-DEV] [RFC] Modern Compression (zstd, brotli)

2025-02-18 Thread Paul Dragoonis
Hey, On Tue, 18 Feb 2025, 13:04 Tim Düsterhus, wrote: > Hi > > Am 2025-02-18 13:46, schrieb Jordi Boggiano: > >> My question is: Why? Please also have a look at: > >> > https://github.com/php/policies/blob/main/coding-standards-and-naming.rst#namespaces. > > >> Instead of creating a top-level na

Re: [PHP-DEV] [RFC] Modern Compression (zstd, brotli)

2025-02-18 Thread Tim Düsterhus
Hi Am 2025-02-18 13:46, schrieb Jordi Boggiano: My question is: Why? Please also have a look at: https://github.com/php/policies/blob/main/coding-standards-and-naming.rst#namespaces. Instead of creating a top-level namespace for both Brotli and Zstd it would probably make sense to create a new

Re: [PHP-DEV] Fully overridable factory methods

2025-02-18 Thread Rob Landers
On Tue, Feb 18, 2025, at 20:29, Juris Evertovskis wrote: > On 2025-02-18 19:31, Rob Landers wrote: > >> >> >> On Tue, Feb 18, 2025, at 17:52, Juris Evertovskis wrote: >>> Hi, >>> >>> A recent discussion brought up the need for multiple constructors for the >>> same class. >>> https://extern

Re: [PHP-DEV] [RFC] Modern Compression (zstd, brotli)

2025-02-18 Thread Benjamin Außenhofer
Am 18.02.2025, 11:19:26 schrieb Jordi Boggiano : > Hey, > > Kévin Dunglas and myself would like to present this RFC proposing > inclusion of the zstandard and brotli pecl extensions into core, with > the main goal of making them more broadly available. > > https://wiki.php.net/rfc/modern_compressi

Re: [PHP-DEV] [RFC] Modern Compression (zstd, brotli)

2025-02-18 Thread Jakub Zelenka
On Tue 18. 2. 2025 at 11:21, Jordi Boggiano wrote: > Hey, > > Kévin Dunglas and myself would like to present this RFC proposing > inclusion of the zstandard and brotli pecl extensions into core, It would be really good to get some thoughts of the author of these extensions (kjdev) because that’

[PHP-DEV] Fully overridable factory methods

2025-02-18 Thread Juris Evertovskis
Hi, A recent discussion brought up the need for multiple constructors for the same class. https://externals.io/message/126428 The need was mostly answered by suggestions to use factory methods. However on an earlier discussion it was discussed how it's fine and even useful for constructor

New RFC discussions (was: Re: [PHP-DEV] Fully overridable factory methods)

2025-02-18 Thread Tim Düsterhus
Hi On 2/18/25 18:31, Rob Landers wrote: You may be interested in a super-draft RFC that I’ll propose in the next few days… May I kindly request some breathing room with regard to new RFC discussions so that folks are able to give each RFC the proper attention. The list currently is super ac

Re: [PHP-DEV] Fully overridable factory methods

2025-02-18 Thread Juris Evertovskis
On 2025-02-18 19:31, Rob Landers wrote: On Tue, Feb 18, 2025, at 17:52, Juris Evertovskis wrote: Hi, A recent discussion brought up the need for multiple constructors for the same class. https://externals.io/message/126428 The need was mostly answered by suggestions to use factory methods

Re: [PHP-DEV] [RFC] Modern Compression (zstd, brotli)

2025-02-18 Thread Ben Ramsey
On Feb 18, 2025, at 08:43, Kévin Dunglas wrote:Hi there,Here is an alternative proposal we just discussed with Jordi:First, reduce the scope of our RFC to simply add new stream wrappers for Zstandard and Brotli similar to those already provided for zlib: https://www.php.net/manual/en/wrappers.com

Re: New RFC discussions (was: Re: [PHP-DEV] Fully overridable factory methods)

2025-02-18 Thread Rob Landers
On Tue, Feb 18, 2025, at 20:24, Tim Düsterhus wrote: > Hi > > On 2/18/25 18:31, Rob Landers wrote: > > You may be interested in a super-draft RFC that I’ll propose in the next > > few days… > > May I kindly request some breathing room with regard to new RFC > discussions so that folks are able

Re: [PHP-DEV] [RFC] Modern Compression (zstd, brotli)

2025-02-18 Thread Tim Düsterhus
Hi Am 2025-02-18 11:19, schrieb Jordi Boggiano: Thanks for your consideration, we're looking forward to hearing your feedback! The RFC specifies that: The zstd implementation includes a few global functions as well as namespaced ones My question is: Why? Please also have a look at: https

Re: [PHP-DEV] Concept: constructor overloading syntax sugar

2025-02-18 Thread Tim Düsterhus
Hi Am 2025-02-18 09:00, schrieb Rowan Tommins [IMSoP]: Personally, I think quite the opposite: named constructors make a lot more sense than type-based overloads. For instance, you might have both createFromJson and createFromYaml; their inputs are both going to be "string" as far as the type

Re: [PHP-DEV] PHP True Async

2025-02-18 Thread Rob Landers
On Mon, Feb 17, 2025, at 20:31, Edmond Dantes wrote: > > There should be no perceptible difference between a blocking sleep(10) and > > an async sleep(10), so what backwards compatibility are you referring to? > > For example, the behavior of the code below will not change. The code will > ex

Re: [PHP-DEV] [RFC] Add get_error_handler(), get_exception_handler() functions

2025-02-18 Thread Jordi Boggiano
On 11.02.2025 14:18, Arnaud Le Blanc wrote: At the moment, there is no direct way to fetch the currently registered error or exception handlers. Users who need to inspect these handlers must resort to a workaround that temporarily sets a new handler and then immediately restores the previous one:

Re: [PHP-DEV] [RFC] Modern Compression (zstd, brotli)

2025-02-18 Thread Tim Düsterhus
Hi Am 2025-02-18 14:22, schrieb Paul Dragoonis: Having spent many years in PHP-FIG and lots of effort trying to build one "standard" for lots of implementations that differ. I just want to point out that I think we should avoid trying to make a standard design for all the Compression drivers a

Re: [PHP-DEV] Concept: constructor overloading syntax sugar

2025-02-18 Thread Lynn
On Tue, Feb 18, 2025 at 10:27 AM Viktor Khramov wrote: > Decision::createFromId($uuid, $comment); > Decision::createFromMail($subject, $body); > Decision::createFromSome($a, $b, $c); > Decision::createFromAnother($a); > > This doesn't look like constructors. It will be hard to read the > class, i

Re: [PHP-DEV] [RFC] Modern Compression (zstd, brotli)

2025-02-18 Thread Jordi Boggiano
Hey Tim, On 18.02.2025 12:30, Tim Düsterhus wrote: My question is: Why? Please also have a look at: https://github.com/php/policies/blob/main/coding-standards-and-naming.rst#namespaces. Instead of creating a top-level namespace for both Brotli and Zstd it would probably make sense to create a

Re: [PHP-DEV] PHP True Async

2025-02-18 Thread Edmond Dantes
> > I think what bilge was trying to point out is that there should be > absolutely no change on existing software with or without the scheduler > running (for software not using fibers). > I thought the same. But where would you hide Fibers? They are part of the language. The existence of Fibers

Re: [PHP-DEV] [RFC] Modern Compression (zstd, brotli)

2025-02-18 Thread Kévin Dunglas
Hi there, Here is an alternative proposal we just discussed with Jordi: First, reduce the scope of our RFC to simply add new stream wrappers for Zstandard and Brotli similar to those already provided for zlib: https://www.php.net/manual/en/wrappers.compression.php PECL extensions for Brotli and

Re: [PHP-DEV] Concept: constructor overloading syntax sugar

2025-02-18 Thread Valentin Udaltsov
On Tue, 18 Feb 2025 at 12:45, Sebastian Bergmann wrote: > Am 18.02.2025 um 09:00 schrieb Rowan Tommins [IMSoP]: > > named constructors make a lot more sense than type-based overloads > > +1 > Hi, Viktor. I agree with others that named static constructors are much better than overloading of the

[PHP-DEV] [RFC] Modern Compression (zstd, brotli)

2025-02-18 Thread Jordi Boggiano
Hey, Kévin Dunglas and myself would like to present this RFC proposing inclusion of the zstandard and brotli pecl extensions into core, with the main goal of making them more broadly available. https://wiki.php.net/rfc/modern_compression Thanks for your consideration, we're looking forward t

Re: [PHP-DEV] [RFC] Modern Compression (zstd, brotli)

2025-02-18 Thread Ayesh Karunaratne
> First, reduce the scope of our RFC to simply add new stream wrappers for > Zstandard and Brotli similar to those already provided for zlib: > https://www.php.net/manual/en/wrappers.compression.php > To keep things moving quickly, we won't be adding any new functions or > classes (perhaps just

Re: [PHP-DEV] Concept: constructor overloading syntax sugar

2025-02-18 Thread Viktor Khramov
Decision::createFromId($uuid, $comment); Decision::createFromMail($subject, $body); Decision::createFromSome($a, $b, $c); Decision::createFromAnother($a); This doesn't look like constructors. It will be hard to read the class, it will take time to come up with a name, it's not right. I have differ

Re: [PHP-DEV] Concept: constructor overloading syntax sugar

2025-02-18 Thread Rowan Tommins [IMSoP]
On 17 February 2025 14:39:42 GMT, Viktor Khramov wrote: >Hi! > >The point is here: >https://gist.github.com/vhood/665418835e65be26d5a818fded92ab75 >Static functions look awful and break the object's API. Personally, I think quite the opposite: named constructors make a lot more sense than

Re: [PHP-DEV] Concept: constructor overloading syntax sugar

2025-02-18 Thread Sebastian Bergmann
Am 18.02.2025 um 09:00 schrieb Rowan Tommins [IMSoP]: named constructors make a lot more sense than type-based overloads +1