Re: stat/fstat
| From: | Brian Foddy | Date: | Fri, 11 May 2001 17:49:08 +0000 |
| Subject: | Re: stat/fstat | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-54890@lists.php.net to get a copy of this message | ||
Zeev Suraski wrote:
>
> At 18:21 11/5/2001, Brian Foddy wrote:
> >derick@php.net wrote:
> > >
> > > On 11 May 2001, Stig Sæther Bakken wrote:
> > >
> > > > Why not have both numerical and descriptive indices? Backwards
> > > > compatible, slightly bloatish, but not really a problem.
> > >
> > > it's already implemented this way now (it was added last night) AFAIK
> > >
> > > Derick Rethans
> > >
> >
> >You are creating the same array indexed both by a
> >integer and a string? I'm curious how this is done. I might
> >have a good use for this trick.
>
> No special tricks needed; PHP's arrays support both numeric and string
> indices ever since PHP 3.0 (at least). You can simply add both types of
> indices to the same array without having to do anything special.
>
Thanks everyone, I knew arrays could be one or the other, but
never considered the same value with multiple indexes. I have
a perfect use for this, where an array I build, the values
have a int index value, and a string an equiv string name.
I'm already doing the zend_hash_update and index_update functions
anyway,
so this should be pretty easy.
Question, what will zend_hash_get_current_key return if it gets
input like this?
Brian