3 ms·
I don't think there's an ambiguity, since the key-value application of that operator only happens inside the array definition or when you do foreach ($x as $k =
by bufferoverflow 7y ago
I don't think there's an ambiguity, since the key-value application of that operator only happens inside the array definition or when you do foreach ($x as $k => $v) {}.
- TimothyBJacobs 7y agoThere is ambiguity. This was specifically mentioned in the RFC for the feature: https://wiki.php.net/rfc/arrow_functions_v2#syntax https://wiki.php.net/rfc/arrow_functions_v2#syntax
- Izkata 7y agoIt does if you're trying to make an array of anonymous functions...