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 expected
var_dump($foo['one']['two']['three']['four'] ) ;

Can anyone enlighten me?

I spotted this because I was getting unexpected results with isset()
used on multi-dimensional arrays.

I'm using the latest version of PHP4 on Debian.

------------------ 
Geoff Caplan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to