Re: [PHP-DEV] [RFC][Discussion] NotSerializable attribute

2024-01-03 Thread Larry Garfield
On Wed, Jan 3, 2024, at 7:11 AM, Nicolas Grekas wrote: > Hi Max, > > Hi, I'd like to propose a new attribute, #[NotSerializable]. This >> functionality is already available for internal classes - userspace should >> benefit from it, too. >> >> The RFC: https://wiki.php.net/rfc/not_serializable >>

Re: [PHP-DEV] [RFC][Discussion] NotSerializable attribute

2024-01-03 Thread Michał Marcin Brzuchalski
śr., 3 sty 2024 o 11:10 Nicolas Grekas napisał(a): > śr., 3 sty 2024 o 08:12 Nicolas Grekas napisał(a): > Hi Max, > > Hi, I'd like to propose a new attribute, #[NotSerializable]. This > > functionality is already available for internal classes - userspace >

Re: [PHP-DEV] [RFC][Discussion] NotSerializable attribute

2024-01-03 Thread G. P. B.
On Wed, 3 Jan 2024 at 13:17, Max Semenik wrote: > > this actively prevents writing a child class that'd make a parent > serializable if it wants to. > > Wouldn't this violate LSP? > No it doesn't. Making a child class unserializable if the parent is serializable however is violating LSP, and

Re: [PHP-DEV] [RFC][Discussion] NotSerializable attribute

2024-01-03 Thread Max Semenik
On Wed, Jan 3, 2024 at 10:11 AM Nicolas Grekas wrote: > > Regarding the inheritance-related behavior ("The non-serializable flag is > inherited by descendants"), this is very unlike any other attributes, and > this actively prevents writing a child class that'd make a parent > serializable if it

Re: [PHP-DEV] [RFC][Discussion] NotSerializable attribute

2024-01-03 Thread Nicolas Grekas
> > >>> śr., 3 sty 2024 o 08:12 Nicolas Grekas >>> napisał(a): >>> Hi Max, Hi, I'd like to propose a new attribute, #[NotSerializable]. This > functionality is already available for internal classes - userspace should > benefit from it, too. > > The RFC:

Re: [PHP-DEV] [RFC][Discussion] NotSerializable attribute

2024-01-03 Thread Michał Marcin Brzuchalski
śr., 3 sty 2024 o 10:09 Nicolas Grekas napisał(a): > Hi Nicolas, >> >> śr., 3 sty 2024 o 08:12 Nicolas Grekas >> napisał(a): >> >>> Hi Max, >>> >>> Hi, I'd like to propose a new attribute, #[NotSerializable]. This >>> > functionality is already available for internal classes - userspace >>>

Re: [PHP-DEV] [RFC][Discussion] NotSerializable attribute

2024-01-03 Thread Nicolas Grekas
> Hi Nicolas, > > śr., 3 sty 2024 o 08:12 Nicolas Grekas > napisał(a): > >> Hi Max, >> >> Hi, I'd like to propose a new attribute, #[NotSerializable]. This >> > functionality is already available for internal classes - userspace >> should >> > benefit from it, too. >> > >> > The RFC:

Re: [PHP-DEV] [RFC][Discussion] NotSerializable attribute

2024-01-03 Thread Michał Marcin Brzuchalski
Hi Nicolas, śr., 3 sty 2024 o 08:12 Nicolas Grekas napisał(a): > Hi Max, > > Hi, I'd like to propose a new attribute, #[NotSerializable]. This > > functionality is already available for internal classes - userspace > should > > benefit from it, too. > > > > The RFC:

Re: [PHP-DEV] [RFC][Discussion] NotSerializable attribute

2024-01-03 Thread Dusk
On Jan 2, 2024, at 23:11, Nicolas Grekas wrote: > Regarding the inheritance-related behavior ("The non-serializable flag is > inherited by descendants"), this is very unlike any other attributes, and > this actively prevents writing a child class that'd make a parent > serializable if it wants

Re: [PHP-DEV] [RFC][Discussion] NotSerializable attribute

2024-01-02 Thread Nicolas Grekas
Hi Max, Hi, I'd like to propose a new attribute, #[NotSerializable]. This > functionality is already available for internal classes - userspace should > benefit from it, too. > > The RFC: https://wiki.php.net/rfc/not_serializable > Proposed implementation:

Re: [PHP-DEV] [RFC][Discussion] NotSerializable attribute

2023-12-10 Thread Max Semenik
On Sat, Dec 9, 2023 at 7:18 PM Niels Dossche wrote: > If you instead put #[NotSerializable] on the parent class MyClass, then > the child class won't be serializable even if you implement the > serialization methods in the child. > Is this intentional? If yes, this should probably be clarified

Re: [PHP-DEV] [RFC][Discussion] NotSerializable attribute

2023-12-09 Thread G. P. B.
The implementation is simple and straight to the point, and uses machinery that has been added to the engine to deal more consistently with internal classes. In an ideal world (IMHO) serialization would be opt-in and __serialize() would be used to enable and describe the serialization format.

Re: [PHP-DEV] [RFC][Discussion] NotSerializable attribute

2023-12-09 Thread Rowan Tommins
On 9 December 2023 12:30:29 GMT, Max Semenik wrote: >Hi, I'd like to propose a new attribute, #[NotSerializable]. This >functionality is already available for internal classes - userspace should >benefit from it, too. If this ends up approximately the same as implementing serialisation as an

Re: [PHP-DEV] [RFC][Discussion] NotSerializable attribute

2023-12-09 Thread Niels Dossche
On 12/9/23 17:28, Larry Garfield wrote: > On Sat, Dec 9, 2023, at 10:17 AM, Niels Dossche wrote: >> Hi Max >> >> On 12/9/23 13:30, Max Semenik wrote: >>> Hi, I'd like to propose a new attribute, #[NotSerializable]. This >>> functionality is already available for internal classes - userspace should

Re: [PHP-DEV] [RFC][Discussion] NotSerializable attribute

2023-12-09 Thread Larry Garfield
On Sat, Dec 9, 2023, at 10:17 AM, Niels Dossche wrote: > Hi Max > > On 12/9/23 13:30, Max Semenik wrote: >> Hi, I'd like to propose a new attribute, #[NotSerializable]. This >> functionality is already available for internal classes - userspace should >> benefit from it, too. >> >> The RFC:

Re: [PHP-DEV] [RFC][Discussion] NotSerializable attribute

2023-12-09 Thread Niels Dossche
Hi Max On 12/9/23 13:30, Max Semenik wrote: > Hi, I'd like to propose a new attribute, #[NotSerializable]. This > functionality is already available for internal classes - userspace should > benefit from it, too. > > The RFC: https://wiki.php.net/rfc/not_serializable > Proposed implementation:

Re: [PHP-DEV] [RFC][Discussion] NotSerializable attribute

2023-12-09 Thread Dennis Snell via internals
> On Dec 9, 2023, at 4:55 PM, Robert Landers wrote: > > On Sat, Dec 9, 2023 at 4:32 PM Dennis Snell via internals > wrote: >> >> Max, I love this idea. >> >> Would it make sense to flip the design though and add `#[Serializable]` with >> a new `php.ini` setting? >> >> I’m thinking that

[PHP-DEV] [RFC][Discussion] NotSerializable attribute

2023-12-09 Thread Max Semenik
Hi, I'd like to propose a new attribute, #[NotSerializable]. This functionality is already available for internal classes - userspace should benefit from it, too. The RFC: https://wiki.php.net/rfc/not_serializable Proposed implementation: https://github.com/php/php-src/pull/12788 Please let me