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

2020-07-11 Thread Levi Morrison
On Fri, Jul 10, 2020 at 2:42 AM Nikita Popov wrote: > > Hi internals, > > I have opened voting on the named arguments RFC: > https://wiki.php.net/rfc/named_params > > Voting will close on 2020-07-24. > > Regards, > Nikita I have decided to vote yes, though I'm a bit skeptical on a few points. Not

Re: [PHP-DEV] Possible RFC: UniqueInterface that throws exception at refcount > 1

2020-07-11 Thread Rowan Tommins
On 11 July 2020 22:47:21 BST, "Olle Härstedt" wrote: >You're misunderstanding. :) Yes, it should be shared, but not with the >same access level as the owner. If a dependent class closes the >connection it will cause spooky-action-at-a-distance somewhere else in >the program. I think that partic

Re: [PHP-DEV] Possible RFC: UniqueInterface that throws exception at refcount > 1

2020-07-11 Thread Max Semenik
On Sun, Jul 12, 2020 at 12:47 AM Olle Härstedt wrote: > You're misunderstanding. :) Yes, it should be shared, but not with the > same access level as the owner. If a dependent class closes the > connection it will cause spooky-action-at-a-distance somewhere else in > the program. Sorry, it's rela

Re: [PHP-DEV] Possible RFC: UniqueInterface that throws exception at refcount > 1

2020-07-11 Thread Olle Härstedt
2020-07-11 21:25 GMT, Larry Garfield : > On Sat, Jul 11, 2020, at 4:04 PM, Olle Härstedt wrote: > >> > I think that would do a far better job of addressing the >> > shared-mutable-state issue than reference counting, because it attacks >> > the >> > root problem rather than a symptom. >> > >> > --L

Re: [PHP-DEV] Possible RFC: UniqueInterface that throws exception at refcount > 1

2020-07-11 Thread Larry Garfield
On Sat, Jul 11, 2020, at 4:04 PM, Olle Härstedt wrote: > > I think that would do a far better job of addressing the > > shared-mutable-state issue than reference counting, because it attacks the > > root problem rather than a symptom. > > > > --Larry Garfield > > > > -- > > PHP Internals - PHP Run

Re: [PHP-DEV] Possible RFC: UniqueInterface that throws exception at refcount > 1

2020-07-11 Thread Olle Härstedt
2020-07-11 19:08 GMT, Larry Garfield : > On Sat, Jul 11, 2020, at 9:06 AM, Olle Härstedt wrote: >> Dear internals, >> >> I'd like to discuss the concept of ownership in PHP, from the point of >> view of a new interface UniqueInterface (or SplUniqueInterface or >> something), which will throw a Uniq

Re: [PHP-DEV] [CONCEPT][DISCUSSION] Instance as boolean

2020-07-11 Thread Larry Garfield
On Wed, Jul 8, 2020, at 11:39 AM, Josh Bruce wrote: > Link to working draft: https://bit.ly/php-0001 > > Discussion on implementing a means by which a class instance can > interacted with syntactically as a boolean. > > At this point in the discuss the only means discus

Re: [PHP-DEV] Possible RFC: UniqueInterface that throws exception at refcount > 1

2020-07-11 Thread Marco Pivetta
Hey Olle, On Sat, Jul 11, 2020 at 4:06 PM Olle Härstedt wrote: > Dear internals, > > I'd like to discuss the concept of ownership in PHP, from the point of > view of a new interface UniqueInterface (or SplUniqueInterface or > something), which will throw a UniqueException if refcount > 1. > > Us

Re: [PHP-DEV] Possible RFC: UniqueInterface that throws exception at refcount > 1

2020-07-11 Thread Larry Garfield
On Sat, Jul 11, 2020, at 9:06 AM, Olle Härstedt wrote: > Dear internals, > > I'd like to discuss the concept of ownership in PHP, from the point of > view of a new interface UniqueInterface (or SplUniqueInterface or > something), which will throw a UniqueException if refcount > 1. > > Use-case: M

Re: [PHP-DEV] VCS Account Request: ondrejmirtes

2020-07-11 Thread Niklas Keller
Am Sa., 11. Juli 2020 um 08:04 Uhr schrieb Kalle Sommer Nielsen < ka...@php.net>: > Hi > > Den lør. 11. jul. 2020 kl. 08.55 skrev Ondřej Mirtes : > > Oh, thank you. Should I fill out this form? > https://wiki.php.net/?do=register > > Yes that is the one. Someone with wiki admin karma needs to gran

[PHP-DEV] [VOTE] zend.exception_string_param_max_len: Configurable string length in getTraceAsString()

2020-07-11 Thread tyson andre
Hi internals, Voting has started on https://wiki.php.net/rfc/throwable_string_param_max_len This proposes adding a new ini setting `zend.exception_string_param_max_len` that would allow changing the string byte limit to any value between 0 and 100, keeping the current default of 15 bytes. (C

Re: [PHP-DEV] Possible RFC: UniqueInterface that throws exception at refcount > 1

2020-07-11 Thread Olle Härstedt
2020-07-11 16:50 GMT, Rowan Tommins : > On 11 July 2020 16:13:24 BST, "Olle Härstedt" > wrote: >>Yes, the point is to be limiting. :) Just like with immutability, you >>apply certain limitations to avoid access abuse. > > > Taken to extremes, this is the "secure a server by encasing it in concrete

Re: [PHP-DEV] Possible RFC: UniqueInterface that throws exception at refcount > 1

2020-07-11 Thread Rowan Tommins
On 11 July 2020 16:13:24 BST, "Olle Härstedt" wrote: >Yes, the point is to be limiting. :) Just like with immutability, you >apply certain limitations to avoid access abuse. Taken to extremes, this is the "secure a server by encasing it in concrete" strategy - the hard part about designing usef

Re: [PHP-DEV] Possible RFC: UniqueInterface that throws exception at refcount > 1

2020-07-11 Thread Max Semenik
On Sat, Jul 11, 2020 at 5:32 PM tyson andre wrote: > This is something that makes more sense in compiled languages like rust > that can enforce uniqueness at compile time, > and the dynamic nature of php makes that less practical. > Also, crucially, Rust has language features that require a prog

Re: [PHP-DEV] Possible RFC: UniqueInterface that throws exception at refcount > 1

2020-07-11 Thread Chuck Adams
On Sat, Jul 11, 2020 at 8:56 AM Rowan Tommins wrote: > (and, funnily enough, PHP 4 did for objects). The funny thing about it for me is that this behavior caused me to throw such a fit when I discovered it -- more to say burned by it -- that I swore off PHP forever at the time. Now I actually w

Re: [PHP-DEV] Possible RFC: UniqueInterface that throws exception at refcount > 1

2020-07-11 Thread Olle Härstedt
2020-07-11 14:56 GMT, Rowan Tommins : > Hi Olle, > > On 11 July 2020 15:06:13 BST, "Olle Härstedt" > wrote: >>I'd like to discuss the concept of ownership in PHP, from the point of >>view of a new interface UniqueInterface (or SplUniqueInterface or >>something), which will throw a UniqueException

Re: [PHP-DEV] Possible RFC: UniqueInterface that throws exception at refcount > 1

2020-07-11 Thread Olle Härstedt
2020-07-11 14:55 GMT, tyson andre : >> Yes, it would be a dynamic uniqueness system, kind of. >> >> Another more flexible alternative would be to add magic methods at >> refcount = 1 and refcount > 1, possibly __owned() and __shared(int >> $refcount), for classes that implement a TrackReferencesInt

Re: [PHP-DEV] Possible RFC: UniqueInterface that throws exception at refcount > 1

2020-07-11 Thread Rowan Tommins
Hi Olle, On 11 July 2020 15:06:13 BST, "Olle Härstedt" wrote: >I'd like to discuss the concept of ownership in PHP, from the point of >view of a new interface UniqueInterface (or SplUniqueInterface or >something), which will throw a UniqueException if refcount > 1. It's an intriguing idea, but I

Re: [PHP-DEV] Possible RFC: UniqueInterface that throws exception at refcount > 1

2020-07-11 Thread tyson andre
> Yes, it would be a dynamic uniqueness system, kind of. > > Another more flexible alternative would be to add magic methods at > refcount = 1 and refcount > 1, possibly __owned() and __shared(int > $refcount), for classes that implement a TrackReferencesInterface or > similar. But this would need

Re: [PHP-DEV] Possible RFC: UniqueInterface that throws exception at refcount > 1

2020-07-11 Thread Olle Härstedt
Thanks for your answers! Yes, it would be a dynamic uniqueness system, kind of. Another more flexible alternative would be to add magic methods at refcount = 1 and refcount > 1, possibly __owned() and __shared(int $refcount), for classes that implement a TrackReferencesInterface or similar. But t

Re: [PHP-DEV] Possible RFC: UniqueInterface that throws exception at refcount > 1

2020-07-11 Thread tyson andre
Hi Olle Härstedt, > I'd like to discuss the concept of ownership in PHP, from the point of > view of a new interface UniqueInterface (or SplUniqueInterface or > something), which will throw a UniqueException if refcount > 1. It'd seem like it would cause a lot of places where UniqueException coul

Re: [PHP-DEV] Possible RFC: UniqueInterface that throws exception at refcount > 1

2020-07-11 Thread Chuck Adams
On Sat, Jul 11, 2020 at 8:06 AM Olle Härstedt wrote: > > Dear internals, > > I'd like to discuss the concept of ownership in PHP, from the point of > view of a new interface UniqueInterface (or SplUniqueInterface or > something), which will throw a UniqueException if refcount > 1. > > Use-case: Mu

[PHP-DEV] Possible RFC: UniqueInterface that throws exception at refcount > 1

2020-07-11 Thread Olle Härstedt
Dear internals, I'd like to discuss the concept of ownership in PHP, from the point of view of a new interface UniqueInterface (or SplUniqueInterface or something), which will throw a UniqueException if refcount > 1. Use-case: Mutable objects that cannot be shared (without (deep) cloning). Ratio

Re: [PHP-DEV] Wiki account request: ondrejmirtes

2020-07-11 Thread Ondřej Mirtes
Hello Nikita, yes, sure, I’ll have this in mind and participate more - be more vocal about my opinions and experience with static analysis and quality code when discussing new language changes. Thank you. On Sat 11. 7. 2020 at 10:19, Nikita Popov wrote: > On Sat, Jul 11, 2020 at 8:19 AM Ondřej M

Re: [PHP-DEV] Wiki account request: ondrejmirtes

2020-07-11 Thread Nikita Popov
On Sat, Jul 11, 2020 at 8:19 AM Ondřej Mirtes wrote: > The main reason is to be able to vote on PHP RFCs. I've created and have > been maintaining PHPStan, a popular open-source static analyser. > > This submission is endorsed by Gabriel Caruso, a current release manager of > PHP 8. > > My wiki.p