Nitpick: there is no need to set element to empty array first, just `$siteAccessesByLanguage[$mainLanguage][] = $sa;` should work the same.