PHP use function return value as array
- by Richard Knop
Why is it that this works:
$cacheMatchesNotPlayed = $cache->load('externalData');
$cacheMatchesNotPlayed = $cacheMatchesNotPlayed['matchesNotPlayed'];
But this doesn't work:
$cacheMatchesNotPlayed = $cache->load('externalData')['matchesNotPlayed'];
Is there some reason for it? The second bit is easier to write.