RE: [PHP] Odd behavior with unset, array indexes, and types

2004-06-17 Thread Michael Sims
Curt Zirzow wrote: > To simplify things: > > $a[2] = '1'; > $k = (double)2; > echo isset($a[$k]); > unset($a[$k]); > echo isset($a[$k]); > echo " -> expect 1\n"; > > > Result: > 11 -> expect 1 Yeah, my version was just a wee bit verbose. :) >> It's the behavior that is specific to u

Re: [PHP] Odd behavior with unset, array indexes, and types

2004-06-17 Thread Curt Zirzow
* Thus wrote Michael Sims: > Thomas Goyne wrote: > > On Thu, 17 Jun 2004 16:52:32 -0500, Michael Sims > > <[EMAIL PROTECTED]> wrote: > >> ceil() returns a variable of type double. In the above script I > >> expected $foo to become an empty array after calling unset(). But > > > However, > > arra

RE: [PHP] Odd behavior with unset, array indexes, and types

2004-06-17 Thread Michael Sims
Thomas Goyne wrote: > On Thu, 17 Jun 2004 16:52:32 -0500, Michael Sims > <[EMAIL PROTECTED]> wrote: >> ceil() returns a variable of type double. In the above script I >> expected $foo to become an empty array after calling unset(). But >> it seems that unset() will not remove an array element whe

Re: [PHP] Odd behavior with unset, array indexes, and types

2004-06-17 Thread Thomas Goyne
On Thu, 17 Jun 2004 16:52:32 -0500, Michael Sims <[EMAIL PROTECTED]> wrote: ceil() returns a variable of type double. In the above script I expected $foo to become an empty array after calling unset(). But it seems that unset() will not remove an array element when you refer to its key usi