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

2004-08-26 Thread Geoff Caplan
Hi folks, Michael Sims wrote: MS IMHO what you have described is a bug in PHP, and if I were you, MS I'd report it as such. If it's not a bug it at least has a very MS high WTF factor. Problem with reporting is that I am using Debian Test and the current PHP version is too old to report. If

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

2004-08-26 Thread Michael Sims
Geoff Caplan wrote: Michael Sims wrote: IMHO what you have described is a bug in PHP, and if I were you, I'd report it as such. If it's not a bug it at least has a very high WTF factor. Problem with reporting is that I am using Debian Test and the current PHP version is too old to report.

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

2004-08-26 Thread Geoff Caplan
Thanks for your help, everyone, especially Michael Sims. I've reported the bug: http://bugs.php.net/bug.php?id=29848 -- Geoff Caplan Vario Software Ltd (+44) 121-515 1154 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Odd behaviour of non-existent keys?

2004-08-25 Thread Geoff Caplan
Hi folks, Getting a result I don't understand. 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'] ) ; // Evaluates to NULL, as

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

2004-08-25 Thread John Holmes
From: Geoff Caplan [EMAIL PROTECTED] Getting a result I don't understand. 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'] ) ; //

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

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

2004-08-25 Thread Geoff Caplan
Michael, MS IMHO what you have described is a bug in PHP, and if I were you, I'd report it as MS such. If it's not a bug it at least has a very high WTF factor. You are right - it does seem like a bug. But I assumed that something as basic as this would have been spotted by now. I don't suppose