bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: test '-v' - associative vs. normal array discrepancy - a bug ?


From: Greg Wooledge
Subject: Re: test '-v' - associative vs. normal array discrepancy - a bug ?
Date: Wed, 19 Nov 2014 15:56:40 -0500
User-agent: Mutt/1.4.2.3i

On Wed, Nov 19, 2014 at 09:52:39PM +0100, Piotr Grzybowski wrote:
>  now I wonder, maybe this:
> 
> $#a
> 
> should return number of elements in array, if a is an array, and
> strlen($a) for scalars?

That would break existing scripts.  $#a already means "argc followed by
the letter a".

If you meant ${#a}, that would *still* break existing scripts, because
${#a} when a is an array currently means "the length of a[0]".



reply via email to

[Prev in Thread] Current Thread [Next in Thread]