Req #53978 [Opn->Fbk]: True multidimensional arrays

From: Date: Mon, 05 Jan 2015 02:31:30 +0000
Subject: Req #53978 [Opn->Fbk]: True multidimensional arrays
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-189652@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=53978&edit=1 ID: 53978 Updated by: danack@php.net Reported by: gordon dot mcvey at ntlworld dot com Summary: True multidimensional arrays -Status: Open +Status: Feedback Type: Feature/Change Request Package: Arrays related Operating System: all PHP Version: Irrelevant Block user comment: N Private report: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2011-02-10 10:14:41] 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. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=53978&edit=1

« previous php.bugs (#189652) next »