|
|
|
|
|
by kijin
2401 days ago
|
|
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. |
|