Re: [PHP-DEV] [RFC][Under discussion] Fetch properties in const expressions

2022-06-22 Thread Alexandru Pătrănescu
On Fri, Jun 17, 2022 at 1:46 AM Ilija Tovilo wrote: > Even without __get the property of an object referenced in the LHS of > The engine evaluates the default property > values once for the entire class and then copies the result whenever a > new instance of that class gets created. That means fu

Re: [PHP-DEV] [RFC] [Under Discussion] Auto-implement Stringable for string backed enums

2022-06-22 Thread Rowan Tommins
On 22/06/2022 18:26, Larry Garfield wrote: The argument presented is that it's easier to type `AppRoles::Admin` than `"admin"`, because the former provides you with an error if you typo something. That's a valid argument, but... not for using enums. It's an argument for using constants. I

Re: [PHP-DEV] [RFC] [Under Discussion] Constants in traits

2022-06-22 Thread shinji igarashi
Wow, nested blockquotes are disappeared completely in externas.io :-) If anyone is reading the discussion via externals.io and misses the context, please check the source of the email. https://externals.io/email/118064/source Thanks! -- Shinji Igarashi 2022年6月23日(木) 6:04 shinji igarashi : > > H

Re: [PHP-DEV] [RFC] [Under Discussion] Constants in traits

2022-06-22 Thread shinji igarashi
Hello Larry, Stefan, and Nicolas! Thanks for the responses. >>> Why were constants left out of traits previously >> That! > So, my working assumption is: it wasn’t something I really thought about. >From what I've read in the old ML archives of discussions on introducing traits to PHP, perhaps c

Re: [PHP-DEV] [RFC] [Under Discussion] Auto-implement Stringable for string backed enums

2022-06-22 Thread Alexandru Pătrănescu
On Wed, Jun 22, 2022 at 8:27 PM Larry Garfield wrote: > > So I am firmly against making it easier to (mis)use enums in a situation > where constants are already the superior solution by every metric. The > only argument I see is making case 1, transitioning from a string to an > enum for a genui

Re: [PHP-DEV] [RFC][Under discussion] Fetch properties in const expressions

2022-06-22 Thread Claude Pache
> Le 17 juin 2022 à 00:46, Ilija Tovilo a écrit : > > (...) > > Since the primary motivation of this RFC is to allow fetching the name > and value properties of enums I'm inclined to forbid using -> on > anything but enums. That would circumvent the issue since enums can't > contain user-defi

Re: [PHP-DEV] [RFC] [Under Discussion] Constants in traits

2022-06-22 Thread Claude Pache
> Le 21 juin 2022 à 23:33, shinji igarashi a écrit : > > Hello everyone! > > I'd like to start a discussion on an RFC to allow defining constants in > traits. > https://wiki.php.net/rfc/constants_in_traits > > I'm looking forward to your feedback, including corrections on English > wording

Re: [PHP-DEV] [RFC] [Under Discussion] Auto-implement Stringable for string backed enums

2022-06-22 Thread Tim Düsterhus
Hi On 6/22/22 19:26, Larry Garfield wrote: In case 1, I'd argue that the function should be switching to an Enum long term *and dropping the string*. For that, a union type is the optimal solution. Does that have BC implications for sub-classes? Well, yes, but so does any type improvement.

Re: [PHP-DEV] [RFC] [Under Discussion] Constants in traits

2022-06-22 Thread Stefan Marr via internals
Hi Nicolas: > On 22 Jun 2022, at 17:31, Nicolas Grekas wrote: > > > I'd like to start a discussion on an RFC to allow defining constants in > > traits. > > https://wiki.php.net/rfc/constants_in_traits > > > > I'm looking forward to your feedback, including corrections on English > > wordings.

Re: [PHP-DEV] [RFC] [Under Discussion] Auto-implement Stringable for string backed enums

2022-06-22 Thread Larry Garfield
On Wed, Jun 22, 2022, at 8:05 AM, Derick Rethans wrote: > On 21 June 2022 23:47:15 BST, Nicolas Grekas > wrote: >>Hi everyone! >> >>I'd like to open a discussion on this RFC, to auto-implement Stringable for >>string-backed enums: >>https://wiki.php.net/rfc/auto-implement_stringable_for_string_ba

Re: [PHP-DEV] [RFC] [Under Discussion] Auto-implement Stringable for string backed enums

2022-06-22 Thread Rowan Tommins
On Tue, 21 Jun 2022 at 23:47, Nicolas Grekas wrote: > Hi everyone! > > I'd like to open a discussion on this RFC, to auto-implement Stringable for > string-backed enums: > https://wiki.php.net/rfc/auto-implement_stringable_for_string_backed_enums > Hi Nicolas, Like others, I'm lukewarm on this

Re: [PHP-DEV] [RFC] [Under Discussion] Constants in traits

2022-06-22 Thread Nicolas Grekas
> > > > I'd like to start a discussion on an RFC to allow defining constants in > traits. > > https://wiki.php.net/rfc/constants_in_traits > > > > I'm looking forward to your feedback, including corrections on English > wordings. > > > > Thanks! > > > > -- > > Shinji Igarashi > > I am initially luk

Re: [PHP-DEV] [RFC] [Under Discussion] Constants in traits

2022-06-22 Thread Larry Garfield
On Tue, Jun 21, 2022, at 4:33 PM, shinji igarashi wrote: > Hello everyone! > > I'd like to start a discussion on an RFC to allow defining constants in > traits. > https://wiki.php.net/rfc/constants_in_traits > > I'm looking forward to your feedback, including corrections on English > wordings. >

Re: [PHP-DEV] [RFC] [Under Discussion] Auto-implement Stringable for string backed enums

2022-06-22 Thread Nicolas Grekas
Hi Benjamin and Derick, I'm replying to both of you because I see some things in common in your comments. >https://wiki.php.net/rfc/auto-implement_stringable_for_string_backed_enums I would prefer if this was an explicit opt-in to have a __toString on a > backed enum. Maybe a special trait for

Re: [PHP-DEV] [RFC] [Under Discussion] New Curl URL API

2022-06-22 Thread Pierrick Charron
HI Hans, any particular reason CurlUrl::getPort() defaults to 0 rather than one of > the valid options? (that being CurlUrl::DEFAULT_PORT > and CurlUrl::NO_DEFAULT_PORT ) > This is because the default is none of those 2 behaviours, If the port wasn't set it will return null, but if the port is t

Re: [PHP-DEV] [RFC] [Under Discussion] Random Extension Improvement

2022-06-22 Thread Tim Düsterhus
Hi On 6/22/22 16:35, Go Kudo wrote: No additional comments seemed to be forthcoming, so the RFC was upgraded to 1.5. The following changes have been made https://wiki.php.net/rfc/random_extension_improvement 1. Add: `Refine classnames` 2. Add: `Random\SerializableEngine is outdated` 3. Add `Ad

Re: [PHP-DEV] [RFC] [Under Discussion] New Curl URL API

2022-06-22 Thread Hans Henrik Bergan
(dammit, mixed sftp:// with ftps:// there, ignore that, i meant sftp:// ) On Wed, 22 Jun 2022 at 16:53, Hans Henrik Bergan wrote: > nitpicking but I kind-of doubt the description > for CurlUrl::NO_DEFAULT_PORT is correct, quote: > > Instructs the method to return null if the port matches the def

Re: [PHP-DEV] [RFC] [Under Discussion] New Curl URL API

2022-06-22 Thread Hans Henrik Bergan
nitpicking but I kind-of doubt the description for CurlUrl::NO_DEFAULT_PORT is correct, quote: > Instructs the method to return null if the port matches the default port for the scheme. makes it sound like these would return null: http://localhost:80/ https://localhost:443/ ftps://localhost:22/ I

Re: [PHP-DEV] [RFC] [Under Discussion] New Curl URL API

2022-06-22 Thread Hans Henrik Bergan
any particular reason CurlUrl::getPort() defaults to 0 rather than one of the valid options? (that being CurlUrl::DEFAULT_PORT and CurlUrl::NO_DEFAULT_PORT ) On Wed, 22 Jun 2022 at 16:23, Pierrick Charron wrote: > Hi Derick, > > > > > > - The new CurlUrl class should probably be immutable from t

Re: [PHP-DEV] [RFC] [Under Discussion] Random Extension Improvement

2022-06-22 Thread Go Kudo
2022年6月18日(土) 4:42 Go Kudo : > Hi internals. > > An RFC has been created to fix an issue in Random Extension 5.x. > > https://wiki.php.net/rfc/random_extension_improvement > > Voting on this RFC will begin in two weeks (2022-07-02), in time for the > PHP 8.2 Feature Freeze. (Vote finished in 2022-

Re: [PHP-DEV] [RFC] [Under Discussion] New Curl URL API

2022-06-22 Thread Pierrick Charron
Hi Derick, > > - The new CurlUrl class should probably be immutable from the start. It > was my biggest mistake not to do that with DateTime. > > Thanks for sharing your lessons learned. But I still see some use cases where mutable objects are easier to use. From the experience you had with DateT

Re: [PHP-DEV] [RFC] [Under Discussion] Auto-implement Stringable for string backed enums

2022-06-22 Thread Derick Rethans
On 21 June 2022 23:47:15 BST, Nicolas Grekas wrote: >Hi everyone! > >I'd like to open a discussion on this RFC, to auto-implement Stringable for >string-backed enums: >https://wiki.php.net/rfc/auto-implement_stringable_for_string_backed_enums > >I'm looking forward to your feedback, I am not in

Re: [PHP-DEV] [RFC] [Under Discussion] Auto-implement Stringable for string backed enums

2022-06-22 Thread Benjamin Eberlei
On Wed, Jun 22, 2022 at 12:47 AM Nicolas Grekas < nicolas.grekas+...@gmail.com> wrote: > Hi everyone! > > I'd like to open a discussion on this RFC, to auto-implement Stringable for > string-backed enums: > https://wiki.php.net/rfc/auto-implement_stringable_for_string_backed_enums > > I'm looking

Re: [PHP-DEV] [RFC] [Under Discussion] New Curl URL API

2022-06-22 Thread Derick Rethans
On 22 June 2022 05:38:13 BST, Pierrick Charron wrote: >Hi, > >Following our discussions we had on the subject of the new Curl URL API, >and other curl improvements. I decided to only focus on adding the new Curl >URL API and put aside all other improvements. Here is the RFC that reflects >our curr

Re: [PHP-DEV] [RFC] [Under Discussion] New Curl URL API

2022-06-22 Thread Craig Francis
On 22 Jun 2022, at 05:38, Pierrick Charron wrote: > Here is the RFC that reflects our current conversations. > > https://wiki.php.net/rfc/curl-url-api > > Feel free to give any feedback, concern or support :-) Thanks Pierrick, I think this is a good approach to add the URL functionality to PH

Re: [PHP-DEV] [RFC] Make the iterator_*() family accept all iterables

2022-06-22 Thread Guilliam Xavier
>> https://externals.io/message/117979 >> https://wiki.php.net/rfc/iterator_xyz_accept_array > Just linking up the previous discussion around this topic: > > GH: https://github.com/php/php-src/pull/3293 > ML: https://externals.io/message/102313 Thanks. More discussion happened after the vote had