Re: [PHP-DEV] [RFC] Property write visibility

2020-06-29 Thread Dik Takken
On 29-06-2020 11:41, André Rømcke wrote: > Good morning Internals, > > I'd like to start discussion on a new RFC proposing a way to be able to > (optionally) specify property > write visibility, separate from read: > > https://wiki.php.net/rfc/property_write_visibility Perhaps another option

[PHP-DEV] Re: [VOTE] Remove inappropriate inheritance signature checks on private methods

2020-06-29 Thread Pedro Magalhães
Hi internals, I'm glad to inform you that the RFC has been accepted with 24 votes for and 11 votes against. https://wiki.php.net/rfc/inheritance_private_methods I'll add some notes to UPGRADING on the PR and hope to get a new review of the implementation before merging it. Thank you again to

Re: [PHP-DEV] [RFC] Property write visibility

2020-06-29 Thread Larry Garfield
On Mon, Jun 29, 2020, at 10:16 AM, David Rodrigues wrote: > With all possibilities maybe we have: > > - public set:private unset:private isset:private get:private > > set:private could be readed like "set is private". > > Where: > > - public is "general visibility" for set, unset, isset and

Re: [PHP-DEV] Improving output of syntax errors

2020-06-29 Thread Rowan Tommins
Hi Claude, On Mon, 29 Jun 2020 at 07:27, Claude Pache wrote: > > > > As a special-case, quoted strings show the string's *content* in double > quotes, e.g. 'unexpected quoted string "foo" ...' rather than 'unexpected > quoted string ""foo"" ...' or 'unexpected quoted string "'foo'" ...'. > >

Re: [PHP-DEV] Improving output of syntax errors

2020-06-29 Thread Claude Pache
> Le 29 juin 2020 à 10:29, Rowan Tommins a écrit : > > > I did actually have strings matching the quote marks used in an earlier > version of the patch, but dropped it partly to simplify the implementation > - because it sometimes truncates strings, it can't just use the real > quotes, but

[PHP-DEV] [RFC] Property write visibility

2020-06-29 Thread André Rømcke
Good morning Internals, I'd like to start discussion on a new RFC proposing a way to be able to (optionally) specify property write visibility, separate from read: https://wiki.php.net/rfc/property_write_visibility This enables readonly, write-only and immutable like semantics for PHP's

[PHP-DEV][RFC] Saner numeric strings

2020-06-29 Thread G. P. B.
Greetings internal, While reviving the "Permit trailing whitespace in numeric strings" RFC [1] I didn't see Nikita's comment on Andrea's original PR which commented on the fact that we should get rid of the "leading-numeric string" concept. Therefore, mostly due to time constraints, I've merge

Re: [PHP-DEV] Improving output of syntax errors

2020-06-29 Thread Claude Pache
> As a special-case, quoted strings show the string's *content* in double > quotes, e.g. 'unexpected quoted string "foo" ...' rather than 'unexpected > quoted string ""foo"" ...' or 'unexpected quoted string "'foo'" ...'. For me, in this case, you have dropped the wrong pair of quotes. That

Re: [PHP-DEV] [RFC] Property write visibility

2020-06-29 Thread Deleu
I don't dislike the syntax and I think I can get used to it extremely fast, tbh. Are there any other languages that have a similar syntax? Has any other language syntax been considered? On Mon, Jun 29, 2020 at 12:01 PM Max Semenik wrote: > On Mon, Jun 29, 2020 at 12:42 PM André Rømcke > wrote:

Re: [PHP-DEV][RFC][VOTE] Rename T_PAAMAYIM_NEKUDOTAYIM to T_DOUBLE_COLON

2020-06-29 Thread Claude Pache
> Le 28 juin 2020 à 00:53, G. P. B. a écrit : > > My perception is that most of the community finds it baffling why anyone > would be against this change. > What baffles me, is the amount of discussion around changing the name of ONE token, whereas it is clear that a bunch of tokens (a few

Re: [PHP-DEV] [RFC] Property write visibility

2020-06-29 Thread Max Semenik
On Mon, Jun 29, 2020 at 12:42 PM André Rømcke wrote: > This enables readonly, write-only and immutable like semantics for PHP's > properties. > I agree that there is a use case for it, however I don't think the proposed syntax `public:private` is intuitive. Maybe we can come up with something

Re: [PHP-DEV] [RFC] Property write visibility

2020-06-29 Thread André Rømcke
man. 29. jun. 2020 kl. 12:06 skrev Deleu : > Are there any other languages that have a similar syntax? Has any other language syntax been considered The only one I could find that matches is Swift: public private(set) var numberOfEdits = 0

Re: [PHP-DEV][RFC] Saner numeric strings

2020-06-29 Thread G. P. B.
On Mon, 29 Jun 2020 at 14:53, Claude Pache wrote: > > > Le 29 juin 2020 à 12:30, G. P. B. a écrit : > > > > Greetings internal, > > > > While reviving the "Permit trailing whitespace in numeric strings" RFC > [1] > > I didn't see Nikita's comment on Andrea's original PR which commented on > >

Re: [PHP-DEV][RFC] Saner numeric strings

2020-06-29 Thread Claude Pache
> Le 29 juin 2020 à 12:30, G. P. B. a écrit : > > Greetings internal, > > While reviving the "Permit trailing whitespace in numeric strings" RFC [1] > I didn't see Nikita's comment on Andrea's original PR which commented on > the fact that we should get rid of the "leading-numeric string"

Re: [PHP-DEV] [RFC] Property write visibility

2020-06-29 Thread André Rømcke
> > >> I agree that there is a use case for it, however I don't think the > proposed syntax `public:private` is intuitive. Maybe we can come up with > something better? > Would something closer to Swift be better? If so I expanded the RFC with that syntax option as well: class User { public

[PHP-DEV] Re: [RFC] Property write visibility

2020-06-29 Thread Mark Randall
On 29/06/2020 10:41, André Rømcke wrote: https://wiki.php.net/rfc/property_write_visibility I'd like this feature as a stop-gap for accessors. However, I don't like the syntax at all, I couldn't reasonably vote for it in its current suggested state. I think it's just too messy. I'm not

Re: [PHP-DEV] Improving output of syntax errors

2020-06-29 Thread Rowan Tommins
On Mon, 29 Jun 2020 at 10:42, Claude Pache wrote: > > At this point, I don’t feel strongly, because currently, when I see > “unexpected (T_CONSTANT_ENCAPSED_STRING)”, > my automatism is not looking for a string with specific quote style (which > is not evident by looking at four consecutive

Re: [PHP-DEV] [RFC] Property write visibility

2020-06-29 Thread Marco Pivetta
Hey André, This does indeed seem to cut into the traditional property accessors scope. I'm no longer seeing a reason to have property accessors, since immutable state (and promotion thereof) is much more relevant to fight bugs and improve application performance and maintainability. Therefore,

Re: [PHP-DEV] [RFC] Property write visibility

2020-06-29 Thread Mark Randall
On 29/06/2020 15:13, André Rømcke wrote: Would something closer to Swift be better? If so I expanded the RFC with that syntax option as well: Borrowing from the various accessors RFCs: public int $x { protected set; protected unset; } Then a future RFC can build upon it by adding the

Re: [PHP-DEV] [RFC] Property write visibility

2020-06-29 Thread Deleu
As a user, I would prefer the original proposed syntax `public:private` or the Swift syntax `public private(set)` than the alternative syntax `public int $x {protected set; protected unset;}`. On Mon, Jun 29, 2020 at 4:22 PM Mark Randall wrote: > On 29/06/2020 15:13, André Rømcke wrote: > >

[PHP-DEV] Re: [RFC] Named arguments

2020-06-29 Thread Nikita Popov
On Tue, Jun 23, 2020 at 12:10 PM Nikita Popov wrote: > On Tue, May 5, 2020 at 3:51 PM Nikita Popov wrote: > >> Hi internals, >> >> I've recently started a thread on resurrecting the named arguments >> proposal (https://externals.io/message/109549), as this has come up >> tangentially in some

Re: [PHP-DEV] [RFC] Property write visibility

2020-06-29 Thread David Rodrigues
With all possibilities maybe we have: - public set:private unset:private isset:private get:private set:private could be readed like "set is private". Where: - public is "general visibility" for set, unset, isset and get; - set: affects write visibility; - unset: affects unset() visibility; -

Re: [PHP-DEV] [RFC] Property write visibility

2020-06-29 Thread Rowan Tommins
On Mon, 29 Jun 2020 at 16:44, Marco Pivetta wrote: > property accessors seem to perpetuate the bad practice > of getters and setters > Outside of access restrictions, a common use case I've seen for property accessors is lazy-loading, which I know is something you use in other forms. > Máté

Re: [PHP-DEV] [RFC] Property write visibility

2020-06-29 Thread Marco Pivetta
Hey Rowan, On Mon, Jun 29, 2020, 18:19 Rowan Tommins wrote: > On Mon, 29 Jun 2020 at 16:44, Marco Pivetta wrote: > > > property accessors seem to perpetuate the bad practice > > of getters and setters > > > > > Outside of access restrictions, a common use case I've seen for property >

Re: [PHP-DEV] Re: [RFC] Named arguments

2020-06-29 Thread Theodore Brown
On Mon, June 29, 2020 at 10:13 AM Nikita Popov wrote: > On Tue, Jun 23, 2020 at 12:10 PM Nikita Popov wrote: > > > As we're moving in on feature freeze, I plan to move this proposal forward > > soonishly. > > > > I have update the RFC to drop the syntax as an open question (I haven't > > seen

Re: [PHP-DEV] [RFC] Property write visibility

2020-06-29 Thread Rowan Tommins
On 29/06/2020 17:21, Marco Pivetta wrote: Hey Rowan, On Mon, Jun 29, 2020, 18:19 Rowan Tommins > wrote: On Mon, 29 Jun 2020 at 16:44, Marco Pivetta mailto:ocram...@gmail.com>> wrote: > property accessors seem to perpetuate the bad practice > of

Re: [PHP-DEV] [RFC] Property write visibility

2020-06-29 Thread Nicolas Grekas
> > I'd like to start discussion on a new RFC proposing a way to be able to > (optionally) specify property > write visibility, separate from read: > > https://wiki.php.net/rfc/property_write_visibility > > This enables readonly, write-only and immutable like semantics for PHP's > properties. > >