#34526 [NEW]: array-related operation to "reduce" contained items

From: Date: Fri, 16 Sep 2005 12:01:15 +0000
Subject: #34526 [NEW]: array-related operation to "reduce" contained items
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-85153@lists.php.net to get a copy of this message
From: soletan at toxa dot de Operating system: Linux PHP version: 5.0.5 PHP Bug Type: Feature/Change Request Bug description: array-related operation to "reduce" contained items Description: ------------ Is it possible to have an array_xxxx-method to perform the transformation on arrays as given below. Since I am working with DBs and wrapping records of tables using classes I often get the case to receive an array as given below and require to pass the list of IDs, only. For sure I can do the transformation all by myself in PHP using foreach. But since my software is getting more and more complex I appreciate any chance to increase my scripts' performance by having such trivial tasks being done in one step. Reproduce code: --------------- before: array( array( 'id' => 1, 'foo' => 'bar' ), array( 'id' => 2, 'foo' => 'bar' ), array( 'id' => 3, 'foo' => 'bar' ), array( 'id' => 4, 'foo' => 'bar' ), array( 'id' => 5, 'foo' => 'bar' ) ); action: $out = array_xxxxx( $in, 'id' ); result: array( 1, 2, 3, 4, 5 ); -- Edit bug report at http://bugs.php.net/?id=34526&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34526&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34526&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34526&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34526&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34526&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34526&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34526&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34526&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34526&r=support Expected behavior: http://bugs.php.net/fix.php?id=34526&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34526&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34526&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34526&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34526&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34526&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34526&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34526&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34526&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34526&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34526&r=mysqlcfg

« previous php.bugs (#85153) next »