News for hackers. Stuff that matters.
Re:PHP 7.4 by kijin on Thursday November 28, 2019 @10:31AM (#21657958)
Mixing named parameters with unnamed ones is ripe for confusion. The syntax is also going to get rather ugly now that parameters can be typed, too. If I need to pass around more than 3-4 parameters and their names/types matter a lot, I think I'll just define a class with clearly named properties and pass around an instance of it.

I'd love to have a shorter object syntax, too. For the time being, I'll make do with

    $city = (object)['name' => 'Berlin', 'population' => 3748000];
which is a little verbose but gets the job done.
Re:PHP 7.4 by asdasdasdasdwd on Thursday November 28, 2019 @11:47AM (#21658627)
I think there is an rfc for object initialization similar to C#:

    $city = new City {name: 'Berlin, population: 374800};
Edit: found it (and it uses = instead of :) https://wiki.php.net/rfc/object-initializer