fix Issue 12908 - [AA] `foreach` by keys and values over associative array in pure function allow impure function calls