4 ms·
[] instead of {} for a map PHP uses [] for both list and map types. I don't think there's any difference between the two types in PHP. All lists are maps.
by andypants 15y ago
[] instead of {} for a map
PHP uses [] for both list and map types.
I don't think there's any difference between the two types in PHP. All lists are maps.
- daeken 15y agoBut we're talking syntax, not behavior. There's no reason they couldn't use {} to indicate maps and [] to indicate lists, even if they're the same data type. The point of this language is to be a cleaner syntax on top of PHP, so syntactical sugar like that is a Good Thing (TM).