Source: sebastiandedeyne.com

Dreaming of nested properties in PHP
https://sebastiandedeyne.com/php-wishlist-nested-properties/ https://sebastiandedeyne.com/tags/php/ https://sebastiandedeyne.com/tags/php-wishlist/Next on my https://sebastiandedeyne.com/tags/php-wishlist are nested properties. I don’t have a good syntax proposal for this, and I’m not even sure it’s the best solution for my problem.

{ public function __construct( public string $index, public string $store, public string $update, public string $delete, ) { { public function __construct( public int $id, public string $name, public string $email, public ContactResourceEndpoints $endpoints, ) { public static function fromContact(Contact $contact): self

Nested properties are also “anonymous” as they don’t have a name, which restricts them to be reused.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners