php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #53978 True multidimensional arrays
Submitted: 2011-02-10 10:14 UTC Modified: 2015-01-18 04:22 UTC
Votes:3
Avg. Score:2.3 ± 1.2
Reproduced:0 of 2 (0.0%)
From: gordon dot mcvey at ntlworld dot com Assigned:
Status: No Feedback Package: Arrays related
PHP Version: Irrelevant OS: all
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: gordon dot mcvey at ntlworld dot com
New email:
PHP Version: OS:

 

 [2011-02-10 10:14 UTC] gordon dot mcvey at ntlworld dot com
Description:
------------
The current PHP arrays of arrays approach to handling complex structures is very powerful and flexible, but it has some real limitations that require you to write workarounds that wouldn't be necessary if PHP also supported true multidimensional arrays.  

For example if you have an array of arrays that represents a piece of tabular data, and you need to be able to sort the table on both of its axes, then you can only sort easily on one axis with one of the array sorting functions.  For the other, you have to foreach(0 over the array, then sort each element in turn to achieve sorting on the opposite axis.  

Additionally, you can only easily add or remove elements on one axis. Again, the other axis would require a foreach.  

Real multidimensional arrays would allow for more flexible processing of data that should be treated as tabular and would be a worthwhile addition to PHP's array toolkit. 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-01-05 02:31 UTC] danack@php.net
-Status: Open +Status: Feedback
 [2015-01-05 02:31 UTC] danack@php.net
Hi, 

can you clarify your request? It may be best to show an implementation in userland PHP code of what you think should be a part of the language, so that other people can clearly see what you want to achieve.
 [2015-01-18 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 17:01:29 2024 UTC