ID:               17763
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Feedback
 Bug Type:         Documentation problem
 Operating System: all
 PHP Version:      4.2.1
-Assigned To:      
+Assigned To:      jmcastagnetto
 New Comment:

Assigning to myself, while waiting for feedback


Previous Comments:
------------------------------------------------------------------------

[2002-06-17 18:24:53] [EMAIL PROTECTED]

Of the scripting languages I've used (Perl, Awk, Python), as well as
some programming langs, usually what you call 'nested array' is
referred to a 'multi-dimensional array' (sometimes interchangeably).

What you are call 'multi-dimensional array' I would think more of a
'multi-dimensional matrix', which is a totally different concept, and
no language I know supports such a structure like that natively.
SciPython has support for matrices, and so do some Java libs, etc.

If you know of a language that supports the behavior you point of in
their *native* array support, I would like to learn. It will be even
more usefule if you got some example C code which can implement such
constructs, a patch to php4/ext/standard/array.[ch] will be the
ultimate "good thing".

Waiting for feedback

------------------------------------------------------------------------

[2002-06-14 09:41:46] [EMAIL PROTECTED]

Hello
I think the term "multi-dimensional array" might be misleading for some
people. Wouldn't "nested array" be more precise?

Look at the following sample:

$myArray = array(
"A"=>Array("1"=>"test","2"=>"test","3"=>"test"),
"B"=>Array("1"=>"test","2"=>"test","3"=>"test"),
"C"=>Array("1"=>"test","2"=>"test","3"=>"test"));

In this sample I can "unset($myArray["B"])" which deletes a elements
associated with the key "B", but there is no function to delete all
elements which are associated with the key "2" in one step. I have to
go through all the elements of the ABC-Array and delete each
"2"-Element seperatly.

In a multi-dimensional array you could delete (and add)Elements in both
dimensions without having to loop through the nested arrays.

PS: I very much like the way PHP organizes Arrays, don't change it. It
is just the term that confuses me.

With Regards
Kristian

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=17763&edit=1

Reply via email to