Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > #34526 : array-related operation to "reduce" contained items
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 14th April 20:53
php-bugs
External User
 
Posts: 1
Default #34526 : array-related operation to "reduce" contained items


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_***x-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_***xx( $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
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666