On Fri, Sep 8, 2023, at 1:12 PM, Lanre Waju wrote:
> Dear PHP Internals,
>
> I am writing to propose a new feature for PHP that introduces the
> concept of structs. This feature aims to provide a more concise and
> expressive way to define and work with immutable data structures. Below
> is a de
On Sat, Sep 9, 2023 at 1:09 AM David Gebler wrote:
>
> On Fri, Sep 8, 2023 at 2:12 PM Lanre Waju wrote:
>
> > Dear PHP Internals,
> >
> > I am writing to propose a new feature for PHP that introduces the
> > concept of structs. This feature aims to provide a more concise and
> > expressive way to
On Fri, Sep 8, 2023 at 2:12 PM Lanre Waju wrote:
> Dear PHP Internals,
>
> I am writing to propose a new feature for PHP that introduces the
> concept of structs. This feature aims to provide a more concise and
> expressive way to define and work with immutable data structures. Below
> is a detai
On Fri, 8 Sept 2023 at 14:12, Lanre Waju wrote:
> Dear PHP Internals,
>
> I am writing to propose a new feature for PHP that introduces the
> concept of structs. This feature aims to provide a more concise and
> expressive way to define and work with immutable data structures. Below
> is a detail
Hi internals!
I think it can be useful for structured data obtained from decoding JSONs
or from a relational database. However, maybe there is an even better idea,
which combines the best of two worlds: the world of your structs RFC, and
native PHP arrays - something like "array shapes".
For inst
I really like the idea of making structs opaque in that sense,
definitely going to put it to vote in the RFC. I agree with the decision
to exclude methods from structs, as they are intended to be pure data
types and If methods are required, classes can be used instead. I guess
based on the resp
On Fri, Sep 8, 2023, 9:15 AM Lanre Waju wrote:
> Allowing Methods in Structs:
> Initially, I suggested that readonly structs have no methods besides the
> constructor. However, upon further consideration, I believe it may be
> beneficial to allow methods in structs. Even PHP enums allow methods,
2023-09-08 15:12 GMT+02:00, Lanre Waju :
> Dear PHP Internals,
>
> I am writing to propose a new feature for PHP that introduces the
> concept of structs. This feature aims to provide a more concise and
> expressive way to define and work with immutable data structures. Below
> is a detailed descri
If you want a new data object with slightly different values
struct Data2 extends Data
{
{string $t, array $meta} $title; // Overwrite parent type
Status $status;
{int $x, int $y} $inlineAnonymous = {x: 1, y: 2};
}
Regarding array functions and serialization, there are two approaches
On Fri, Sep 8, 2023 at 3:12 PM Lanre Waju wrote:
>
> Dear PHP Internals,
>
> I am writing to propose a new feature for PHP that introduces the
> concept of structs. This feature aims to provide a more concise and
> expressive way to define and work with immutable data structures. Below
> is a deta
Dear PHP Internals,
I am writing to propose a new feature for PHP that introduces the
concept of structs. This feature aims to provide a more concise and
expressive way to define and work with immutable data structures. Below
is a detailed description of the proposed syntax, usage, and behavio
11 matches
Mail list logo