The docs are pretty light. The interface looks almost identical to an array.
When should I prefer a dict?
An array is a special variable that we use to store or hold more than one value in a single variable without having to create more variables to store those values. To create an array in PHP, we use the array function array( ) . By default, an array of any variable starts with the 0 index.
There are no dictionaries in php, but PHP array's can behave similarly to dictionaries in other languages because they have both an index and a key (in contrast to Dictionaries in other languages, which only have keys and no index).
Arrays in php are meant to be both dictionaries and vectors. That's very confusing. Also in arrays, there is key coercion to integer. Which is more confusing.
Hack dicts are meant to remove the ambiguity and fix the problem with the keys.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With