in reply to Re: Re^2: Sparse arrays?
in thread Sparse arrays?
That is less powerful than the example I posted and gains you nothing. Three tested states are uninitialied, undefined and defined. My snippet replaces your defined() test with an exists() test which diferentiates between non-existant elements and merely undefined.
The "different" way I was thinking of would probably use something other than for() since for() also returns uninitialized elements. It's not sparse aware. You know - something like each() for arrays.
Fun Fun Fun in the Fluffy Chair
|
---|