Yesterday I learned that not-very-old versions of Bash, when set -o nounset is in effect, treat empty arrays as being unset. 😞
set -o nounset