by kijin · 7y ago · 0 comments
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. $city = new City {name: 'Berlin, population: 374800};
Edit: found it (and it uses = instead of :) https://wiki.php.net/rfc/object-initializer