Re: [PHP-DEV] Alternatives for encapsulation when using composition instead of inheritance

2021-08-26 Thread Alexandru Pătrănescu
On Fri, Aug 27, 2021 at 12:53 AM Rowan Tommins wrote: > On 26 August 2021 21:20:35 BST, "Olle Härstedt" > wrote: > >The Foo class has to decide who to give access to, otherwise it's the > >same as public access. > > > It does decide who has access: any class that declares it as "delegated". >

Re: [PHP-DEV] [RFC] Deprecate dynamic properties

2021-08-26 Thread Mike Schinkel
> On Aug 26, 2021, at 11:02 PM, Pierre Joye wrote: > I don't know how others feel about it, I think most want to go the > path to (2) and a more strict, if not almost fully strict PHP. Core > devs to simplify the engine, users to allow them easier checks and > safety in their frameworks or libs.

Re: [PHP-DEV] [RFC] Deprecate dynamic properties

2021-08-26 Thread Tobias Nyholm
Just giving my 2 cents: > 2. Remove support for dynamic properties entirely. I support this RFC and I like the end goal to be to remove the dynamic properties entirely. Dynamic properties are just confusing for beginners. “This is how you declare properties, the scope, the type, name etc..

Re: [PHP-DEV] [RFC] Deprecate dynamic properties

2021-08-26 Thread Pierre Joye
Hi Stan, On Fri, Aug 27, 2021 at 5:10 AM Stanislav Malyshev wrote: > > Hi! > > > The crux of the issue is what our end goal is: > > > > 1. Require users to explicitly annotate classes that use dynamic > > properties, but otherwise keep dynamic properties as a fully supported part > > of the core

Re: [PHP-DEV] [RFC] Deprecate dynamic properties

2021-08-26 Thread Matthew Brown
On Thu, 26 Aug 2021 at 21:20, Sara Golemon wrote: > We're > going to need to run some static analyzers on some frameworks and > libraries. Who's got it in them to do the research? > > -Sara > I'm not volunteering, but I forked Nikita's package analysis to add Psalm scanning a while ago:

Re: [PHP-DEV] [RFC] Deprecate dynamic properties

2021-08-26 Thread Sara Golemon
On Thu, Aug 26, 2021 at 3:34 AM Nikita Popov wrote: > > The crux of the issue is what our end goal is: > > 1. Require users to explicitly annotate classes that use dynamic properties, > but otherwise keep dynamic properties as a fully supported part of the core language. > That's how I initially

Re: [PHP-DEV] [RFC] Deprecate dynamic properties

2021-08-26 Thread Stanislav Malyshev
Hi! The crux of the issue is what our end goal is: 1. Require users to explicitly annotate classes that use dynamic properties, but otherwise keep dynamic properties as a fully supported part of the core language. 2. Remove support for dynamic properties entirely. The core language only has

Re: [PHP-DEV] Alternatives for encapsulation when using composition instead of inheritance

2021-08-26 Thread Rowan Tommins
On 26 August 2021 21:20:35 BST, "Olle Härstedt" wrote: >The Foo class has to decide who to give access to, otherwise it's the >same as public access. It does decide who has access: any class that declares it as "delegated". In exactly the same way, "protected" gives access to any class that

Re: [PHP-DEV] Alternatives for encapsulation when using composition instead of inheritance

2021-08-26 Thread Olle Härstedt
2021-08-26 22:20 GMT+02:00, Olle Härstedt : > 2021-08-26 20:30 GMT+02:00, Rowan Tommins : >> On 26/08/2021 14:47, Olle Härstedt wrote: >>> Don't know if this already exists, but maybe we could consider >>> brainstorming or gather alternatives for different types of >>> encapsulation when using

Re: [PHP-DEV] Alternatives for encapsulation when using composition instead of inheritance

2021-08-26 Thread Olle Härstedt
2021-08-26 20:30 GMT+02:00, Rowan Tommins : > On 26/08/2021 14:47, Olle Härstedt wrote: >> Don't know if this already exists, but maybe we could consider >> brainstorming or gather alternatives for different types of >> encapsulation when using composition? > > > Although not quite equivalent to

Re: [PHP-DEV] Alternatives for encapsulation when using composition instead of inheritance

2021-08-26 Thread Mike Schinkel
> On Aug 26, 2021, at 9:47 AM, Olle Härstedt wrote: > > Don't know if this already exists, but maybe we could consider > brainstorming or gather alternatives for different types of > encapsulation when using composition? Currently, encapsulation like > private and protected is only possible when

Re: [PHP-DEV] Re: 8.1 / Exception / Property Type / Backwards compatbility

2021-08-26 Thread Nikita Popov
On Thu, Aug 26, 2021 at 8:34 PM Ben Ramsey wrote: > Nikita Popov wrote on 8/26/21 09:57: > > Right. I at least do not plan to address this issue. If you take a > > protected property and publicly re-export it, then any compatibility > issues > > are on you. > > This does not appear to affect

Re: [PHP-DEV] Re: 8.1 / Exception / Property Type / Backwardscompatbility

2021-08-26 Thread Björn Larsson via internals
Den 2021-08-26 kl. 20:34, skrev Ben Ramsey: Nikita Popov wrote on 8/26/21 09:57: Right. I at least do not plan to address this issue. If you take a protected property and publicly re-export it, then any compatibility issues are on you. This does not appear to affect only cases where one is

Re: [PHP-DEV] Re: 8.1 / Exception / Property Type / Backwards compatbility

2021-08-26 Thread Ben Ramsey
Nikita Popov wrote on 8/26/21 09:57: > Right. I at least do not plan to address this issue. If you take a > protected property and publicly re-export it, then any compatibility issues > are on you. This does not appear to affect only cases where one is re-exporting a protected property as public.

Re: [PHP-DEV] Alternatives for encapsulation when using composition instead of inheritance

2021-08-26 Thread Rowan Tommins
On 26/08/2021 14:47, Olle Härstedt wrote: Don't know if this already exists, but maybe we could consider brainstorming or gather alternatives for different types of encapsulation when using composition? Although not quite equivalent to your suggestions, these threads on making delegation to

[PHP-DEV] PHP 7.4.23 Released!

2021-08-26 Thread Derick Rethans
The PHP development team announces the immediate availability of PHP 7.4.23. This is a security and bug fix release. All PHP 7.4 users are encouraged to upgrade to this version. For source downloads of PHP 7.4.23 please visit our downloads page. Windows binaries can be found on the PHP for

Re: [PHP-DEV] Re: 8.1 / Exception / Property Type / Backwards compatbility

2021-08-26 Thread Nikita Popov
On Thu, Aug 26, 2021 at 4:43 PM Dan Ackroyd wrote: > On Thu, 26 Aug 2021 at 12:42, Björn Larsson via internals > wrote: > > > > Den 2021-08-10 kl. 11:55, skrev Philip Hofstetter: > > > The following valid <= PHP 8.0 code that intends to make the $line > property > > > public is a fatal error

Re: [PHP-DEV] Re: 8.1 / Exception / Property Type / Backwards compatbility

2021-08-26 Thread Ben Ramsey
Dan Ackroyd wrote on 8/26/21 09:43: > On Thu, 26 Aug 2021 at 12:42, Björn Larsson via internals > wrote: >> >> Den 2021-08-10 kl. 11:55, skrev Philip Hofstetter: >>> The following valid <= PHP 8.0 code that intends to make the $line property >>> public is a fatal error in 8.1 > >>> >>> For

Re: [PHP-DEV] Re: 8.1 / Exception / Property Type / Backwards compatbility

2021-08-26 Thread Dan Ackroyd
On Thu, 26 Aug 2021 at 12:42, Björn Larsson via internals wrote: > > Den 2021-08-10 kl. 11:55, skrev Philip Hofstetter: > > The following valid <= PHP 8.0 code that intends to make the $line property > > public is a fatal error in 8.1 > > > > For method return types, we have

[PHP-DEV] Re: 8.1 / Exception / Property Type / Backwards compatbility

2021-08-26 Thread Ben Ramsey
Philip Hofstetter wrote on 8/10/21 04:55: > Hello > > The following valid <= PHP 8.0 code that intends to make the $line property > public is a fatal error in 8.1 > > class FooException extends Exception { > public $line; > } > > However, the fixed code for 8.1: > > class FooException

[PHP-DEV] Re: Alternatives for encapsulation when using composition instead of inheritance

2021-08-26 Thread Olle Härstedt
2021-08-26 16:20 GMT+02:00, Christoph M. Becker : > On 26.08.2021 at 15:47, Olle Härstedt wrote: > >> * Friend classes, like in C++: Class B is annotated to be a friend of >> A, so class A can see the content of class B but no other class can. > > has been

Re: [PHP-DEV] Unwrap reference after foreach

2021-08-26 Thread Nikita Popov
On Sat, Aug 14, 2021 at 6:00 PM Claude Pache wrote: > > Le 13 août 2021 à 15:28, Nikita Popov a écrit : > > Hi internals, > > I'd like to address a common footgun when using foreach by reference: > https://wiki.php.net/rfc/foreach_unwrap_ref > > This addresses the issue described in the big red

[PHP-DEV] Re: Alternatives for encapsulation when using composition instead of inheritance

2021-08-26 Thread Christoph M. Becker
On 26.08.2021 at 15:47, Olle Härstedt wrote: > * Friend classes, like in C++: Class B is annotated to be a friend of > A, so class A can see the content of class B but no other class can. has been declined. > * Namespace private: Class A and B are

[PHP-DEV] Alternatives for encapsulation when using composition instead of inheritance

2021-08-26 Thread Olle Härstedt
Hi list! Don't know if this already exists, but maybe we could consider brainstorming or gather alternatives for different types of encapsulation when using composition? Currently, encapsulation like private and protected is only possible when using inheritance - when using composition, that is,

[PHP-DEV] PHP 7.3.30 Released!

2021-08-26 Thread Christoph M. Becker
The PHP development team announces the immediate availability of PHP 7.3.30. This is a security release. All PHP 7.3 users are encouraged to upgrade to this version. For source downloads of PHP 7.3.30 please visit our downloads page. Windows binaries can be found on the PHP for Windows site.

[PHP-DEV] Re: 8.1 / Exception / Property Type / Backwards compatbility

2021-08-26 Thread Björn Larsson via internals
Den 2021-08-10 kl. 11:55, skrev Philip Hofstetter: Hello The following valid <= PHP 8.0 code that intends to make the $line property public is a fatal error in 8.1 class FooException extends Exception { public $line; } However, the fixed code for 8.1: class FooException extends

Re: [PHP-DEV] [RFC] Deprecate dynamic properties

2021-08-26 Thread Mike Schinkel
> On Aug 26, 2021, at 4:04 AM, Reindl Harald (privat) wrote: > Am 26.08.21 um 09:24 schrieb Mike Schinkel: >> https://3v4l.org/HAkhjW#v8.0.9 >> Total execution time for 5000 iterations for BadActor = 0.351906 milliseconds >> Total execution time for 5000 iterations for GoodActor = 0.758886 >>

[PHP-DEV] Re: PHP 8.0.10 Released!

2021-08-26 Thread Gabriel Caruso
On Thu, 26 Aug 2021 at 13:04, Gabriel Caruso wrote: > The PHP development team announces the immediate availability of PHP > 8.0.X. This is a security fix release. > PHP 8.0.10, ops. > > All PHP 8.0 users are encouraged to upgrade to this version. > > For source downloads of PHP 8.0.10 please

[PHP-DEV] PHP 8.0.10 Released!

2021-08-26 Thread Gabriel Caruso
The PHP development team announces the immediate availability of PHP 8.0.X. This is a security fix release. All PHP 8.0 users are encouraged to upgrade to this version. For source downloads of PHP 8.0.10 please visit our downloads page. Windows binaries can be found on the PHP for Windows site.

Re: [PHP-DEV] [RFC] Deprecate dynamic properties

2021-08-26 Thread Nikita Popov
On Wed, Aug 25, 2021 at 5:28 PM Sara Golemon wrote: > On Wed, Aug 25, 2021 at 5:03 AM Nikita Popov wrote: > > I'd like to propose the deprecation of "dynamic properties", that is > > properties that have not been declared in the class (stdClass and > > __get/__set excluded, of course): > > > >

Re: [PHP-DEV] Guidelines for RFC post feature-freeze

2021-08-26 Thread Hossein Baghayi
Hello, One question I have (as I always do) regarding nullable intersection types, (which is a forbidden topic and I know I shouldn't bring it up). I'd love to know how `Consistency` plays a role in new RFCs. Are we striving for consistency? Is it a value here? Or simply it is a side effect? We

Re: [PHP-DEV] [RFC] Deprecate dynamic properties

2021-08-26 Thread Mike Schinkel
> On Aug 26, 2021, at 2:27 AM, Reindl Harald (privat) wrote: > Am 26.08.21 um 00:59 schrieb Mike Schinkel: >>> On Aug 25, 2021, at 6:41 PM, Reindl Harald (privat) >>> wrote: >>> Am 26.08.21 um 00:37 schrieb Mike Schinkel: That said, I'd be really interested in seeing use-cases where having