Re: array_map() function modification

From: Date: Sat, 12 Jan 2013 20:12:54 +0000
Subject: Re: array_map() function modification
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
I'm not sure that adding this functionality in array_map would actually
execute faster than doing array_combine($keys, array_map(null, $vals,
$vals2, $vals3));. I will need to do some benchmarks to test, but I'm sure
you will only see a performance improvement with extremely large arrays.

Also why change a function to add functionality that can already be
achieved with another existing function? Anybody using array_map is already
aware of it's functionality and what it is used for. To change it to add
other use cases, which is already available with array_combine, will just
be confusing to most developers.

If there is a serious need for multiple arrays for values, then I'd rather
argue that array_combine be modified to accept multiple arrays, which won't
break BC, but I doubt that it would be feasible for the majority developers
to have this feature added, as it is very easily implement in user-land
with a few lines of code.

On Sat, Jan 12, 2013 at 9:41 PM, Thomas Hruska <[email protected]>wrote:

> array_combine($keys, array_map(null, $vals, $vals2, $vals3));





Kind Regards
Pierre du Plessis

*Cell*: 072 775 3477
*Fax*: 086 650 4991
*Email*: [email protected] <[email protected]>
*www*: http://www.customscripts.co.za


Thread (8 messages)

« previous php.internals (#64907) next »