Re[2]: [PHP] Odd behaviour of non-existent keys?

2004-08-25 Thread Geoff Caplan
John, Why does the non-existent key in the array below evaluate to the first char of the array value? $foo = '' ; $foo['one']['two'] = 'test-value' ; // Evaluates to: string(1) t var_dump( $foo['one']['two']['three'] ) ; JH Strings are arrays. PHP probably takes the string 'three' and

Re: Re[2]: [PHP] Odd behaviour of non-existent keys?

2004-08-25 Thread ramil
On Wed, 25 Aug 2004 14:04:51 +0100, Geoff Caplan [EMAIL PROTECTED] wrote: I think you are probably right - but this behaviour causes problems. For example: $foo['one']['two'] = test-string ; // Evaluates to TRUE (not what's wanted!) isset( $foo['one']['two']['three'] ) ; I need a

Re: Re[2]: [PHP] Odd behaviour of non-existent keys?

2004-08-25 Thread John Holmes
From: Geoff Caplan [EMAIL PROTECTED] Why does the non-existent key in the array below evaluate to the first char of the array value? $foo = '' ; $foo['one']['two'] = 'test-value' ; // Evaluates to: string(1) t var_dump( $foo['one']['two']['three'] ) ; JH Strings are arrays. PHP probably takes the

RE: Re[2]: [PHP] Odd behaviour of non-existent keys?

2004-08-25 Thread Michael Sims
Geoff Caplan wrote: I think you are probably right - but this behaviour causes problems. For example: $foo['one']['two'] = test-string ; // Evaluates to TRUE (not what's wanted!) isset( $foo['one']['two']['three'] ) ; I need a reliable way to test for the non-existence of a