3 ms·
While you're right, I don't think that's something commonly used. I definitely can't remember the last time I wrote code where this would be useful. That might
by Denvercoder9 6y ago
While you're right, I don't think that's something commonly used. I definitely can't remember the last time I wrote code where this would be useful.
That might be because usage of associative arrays is more or less discouraged in modern PHP in favor of value objects (especially with property promotion in PHP8). Main reason for that is that this usage is horrible for IDEs and static analysis. Way too easy to rename a parameter and create a runtime error. Typing is also enforced at usage instead of creation, and you have to repeat the type information in every function signature.