Is this a bug?

Perry Smith <[email protected]> Sun, 18 Jan 2026 09:38:57 -0600
Newsgroups gmane.comp.shells.zsh.user
Message-ID <[email protected]>
> #!/bin/zsh
> 
> echo $ZSH_PATCHLEVEL
> echo $ZSH_VERSION
> A=( this is an arry of words )
> echo "${#A}"
> unset "A[-1]"
> echo "${#A}"

Result:

> zsh-5.9-0-g73d3173
> 5.9
> 6
> 6

I would expect the last echo to be only 5 instead of 6.

I’m writing a script.  I can easily cope with this but I thought I would mention it.

Thank you,
pedz