Re: [PHP-DEV] [Discussion] Implicitly backed enums

2024-05-21 Thread Stephen Reay
> On 22 May 2024, at 07:58, Larry Garfield wrote: > > given that the casing for an enum should be CamelCase (per PER-CS) Hi Larry; I find myself yet again having to ask that php policies/discussions not revolve around the idea that PHP-FIG is a required/expected part of PHP usage. Until a

Re: [PHP-DEV] [Discussion] Implicitly backed enums

2024-05-21 Thread Aaron Piotrowski
> On May 21, 2024, at 6:47 PM, Bilge wrote: > > On 22/05/2024 00:31, Larry Garfield wrote: >> I could see an argument for auto-populating the backing value off the enum >> name if it's not specified, something like this: >> enum Options: string { >> case First; // This implicitly gets "First"

Re: [PHP-DEV] [Discussion] Implicitly backed enums

2024-05-21 Thread Larry Garfield
On Tue, May 21, 2024, at 6:47 PM, Bilge wrote: > On 22/05/2024 00:31, Larry Garfield wrote: >> I could see an argument for auto-populating the backing value off the enum >> name if it's not specified, something like this: enum Options: string { >> case First; // This implicitly gets "First" >>

Re: [PHP-DEV] [Discussion] Implicitly backed enums

2024-05-21 Thread Bilge
On 22/05/2024 00:31, Larry Garfield wrote: I could see an argument for auto-populating the backing value off the enum name if it's not specified, something like this: enum Options: string { case First; // This implicitly gets "First" case Second = '2nd'; } This seems like a reasonable co

Re: [PHP-DEV] [Discussion] Implicitly backed enums

2024-05-21 Thread Larry Garfield
On Tue, May 21, 2024, at 5:48 PM, Bilge wrote: > On 21/05/2024 23:35, Larry Garfield wrote: >> On Tue, May 21, 2024, at 5:30 PM, Bilge wrote: >>> Hi Internals, >>> >>> I struggle to understand the benefit of "basic" enumerations and their >>> diminished API. In particular, I often find myself wanti

Re: [PHP-DEV] [Discussion] Implicitly backed enums

2024-05-21 Thread mjec
On Tue, 2024-05-21 at 18:48 -04:00, Bilge wrote: > >What would be the downside to having all "basic" enumerations actually > being implicitly "backed" enumerations? I'm not Larry but I see a lot of value in knowing that a unit value was explicitly constructed in code, and where the value canno

Re: [PHP-DEV] [Discussion] Implicitly backed enums

2024-05-21 Thread Bilge
On 21/05/2024 23:35, Larry Garfield wrote: On Tue, May 21, 2024, at 5:30 PM, Bilge wrote: Hi Internals, I struggle to understand the benefit of "basic" enumerations and their diminished API. In particular, I often find myself wanting to use `from()/``tryFrom()` to convert a string to an enumera

Re: [PHP-DEV] [Discussion]

2024-05-21 Thread Larry Garfield
On Tue, May 21, 2024, at 5:30 PM, Bilge wrote: > Hi Internals, > > I struggle to understand the benefit of "basic" enumerations and their > diminished API. In particular, I often find myself wanting to use > `from()/``tryFrom()` to convert a string to an enumeration. To do this, > I must convert

[PHP-DEV] [Discussion]

2024-05-21 Thread Bilge
Hi Internals, I struggle to understand the benefit of "basic" enumerations and their diminished API. In particular, I often find myself wanting to use |from()/||tryFrom()| to convert a string to an enumeration. To do this, I must convert it to a "backed" enum and copy & paste each name to its

Re: [PHP-DEV] [RFC] [Discussion] Add openStream() to XML{Reader,Writer}

2024-05-21 Thread Claude Pache
> Le 21 mai 2024 à 21:00, Matthew Weier O'Phinney a > écrit : >> (But again, I prefer that all those methods work on instances, as it was the >> case before PHP 8. They shouldn’t have been switched to >> static-but-broken-for-subclasses without discussion.) > > Fixing the existing ones would

Re: [PHP-DEV] Switching max_execution_time from CPU time to wall-clock time and from SIGPROF to SIGALRM

2024-05-21 Thread Benjamin Außenhofer
On Fri, May 17, 2024 at 3:49 PM Arnaud Le Blanc wrote: > Hi internals, > > There is an issue with max_execution_time on MacOS, probably only > MacOS 14 on Apple Silicon, that causes timeouts to fire too early [1]. > max_execution_time is implemented with setitimer(ITIMER_PROF) on this > platform,

Re: [PHP-DEV] [RFC] [Discussion] Add openStream() to XML{Reader,Writer}

2024-05-21 Thread Matthew Weier O'Phinney
On Tue, May 21, 2024 at 12:58 PM Claude Pache wrote: > > > > Le 18 mai 2024 à 01:13, Niels Dossche a écrit > : > > > > On 22/04/2024 20:41, Niels Dossche wrote: > >> Hi internals > >> > >> I'm opening the discussion for my RFC "Add openStream() to > XML{Reader,Writer}". > >> RFC link: https://wi

Re: [PHP-DEV] [RFC] [Discussion] Add openStream() to XML{Reader,Writer}

2024-05-21 Thread Claude Pache
> Le 18 mai 2024 à 01:13, Niels Dossche a écrit : > > On 22/04/2024 20:41, Niels Dossche wrote: >> Hi internals >> >> I'm opening the discussion for my RFC "Add openStream() to >> XML{Reader,Writer}". >> RFC link: https://wiki.php.net/rfc/xmlreader_writer_streams >> >> Kind regards >> Niels

Re: [PHP-DEV] Switching max_execution_time from CPU time to wall-clock time and from SIGPROF to SIGALRM

2024-05-21 Thread Rob Landers
On Tue, May 21, 2024, at 14:39, Arnaud Le Blanc wrote: > Hi Robert, > > > This sounds like a bug with Mac vs. a PHP issue. > > This is what I believe as well. FWIW I was able to reproduce the issue > outside of PHP [2]. I've reported the bug to Apple, but I don't expect > it to be fixed quickly

Re: [PHP-DEV] Switching max_execution_time from CPU time to wall-clock time and from SIGPROF to SIGALRM

2024-05-21 Thread Kévin Dunglas
Hello, I'm in favor of merging Arnaud's patch for macOS while waiting for a better solution like relying on Grand Central Dispatch or another non-signal-based solution (https://github.com/php/php-src/pull/13468), which would allow max_execution_time to work with ZTS builds on mac as well. I'm als

Re: [PHP-DEV] ext/pgsql: pg_put_line deprecation proposal

2024-05-21 Thread Matteo Beccati
Hi David, Il 21/05/2024 07:53, David CARLIER ha scritto: Thanks for your thoughts, I ve overlooked this. No worries! However, we might want to expose the functionalities from PQputCopyData and PQputCopyEnd and perhaps PQgetCopyData at some point. ;-) Cheers -- Matteo Beccati Development

Re: [PHP-DEV] Switching max_execution_time from CPU time to wall-clock time and from SIGPROF to SIGALRM

2024-05-21 Thread Arnaud Le Blanc
Hi Calvin, > FWIW, Cygwin and IBM i are also using wall time, because these platforms > don't do execution time. Thank you for the additional info. > IIRC, the difference between platforms with how > max_execution_time is counted doesn't seem to be documented last I checked. Currently the max_e

Re: [PHP-DEV] Switching max_execution_time from CPU time to wall-clock time and from SIGPROF to SIGALRM

2024-05-21 Thread Arnaud Le Blanc
Hi Robert, > This sounds like a bug with Mac vs. a PHP issue. This is what I believe as well. FWIW I was able to reproduce the issue outside of PHP [2]. I've reported the bug to Apple, but I don't expect it to be fixed quickly, if at all. > That being said, the > biggest issue between changing t