On Mon, Mar 16, 2020 at 9:26 AM Christian Schneider
<cschn...@cschneid.com> wrote:
> [] suggests an array but then is uses literals and = instead of 
> 'strings'/$vars and => which looks wrong to my PHP eye.
That's ok, square brackets are usually related to arrays and what I
want is something similar to array literals.
The rest of the syntax is exactly the same as when you assign
properties on a object currently.

> you want to initialise so many properties manually instead of through some 
> sort of constructor.
Yes, exactly. From the RFC:
"The purpose of this feature is to lighten the effort of populating
data structures, especially medium to large ones."

And as I say, since we don't have named parameters, this is a
pragmatic alternative.

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to