Ferenc Kovacs wrote:
some clarification:
in the test script, Daniel declared $arr as:
$arr = array('exists' => 'foo');
so when he tests
$arr['exists']['non_existent']
PHP will see that $arr['exists'] is a string, and it will convert the
'non_existent' index to int(0) and that will return the same
as $arr['exists'][0]: 'f'
If he would have defined $arr['exists'] as an array, then the code would work as
he expected, empty would returned true for $arr['exists']['non_existent']

The bit I am missing here is the statement that $arr = array ... has NOT created an array with an element ['exists'] ... I suspect that this is perhaps where the code *I* am looking at is breaking down ... how SHOULD you define the array so that it is an array? So that $family = array ( 'fam1' => 'JONES' ); is the base for the JONES family rather than simply a string. All of this USED to be simple, but it seems to be getting so cryptic that this is what is causing the trouble :(

--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to