Top "Array-map" questions

PHP's array_map() function accepts Callback function to run for each element in each array and an array to run through the callback function.

Performance of foreach, array_map with lambda and array_map with static function

What's the performance difference (if there is any) between these three approaches, both used to transform an array to another …

php performance foreach lambda array-map
array_map inline anonymous function

I tested inline anonymous function with array_map here and it worked but when I tried same with $user_meta …

php array-map
array_map not working in classes

I am trying to create a class to handle arrays but I can't seem to get array_map() to work …

php arrays class function array-map
How can I use array_map with keys and values, but return an array with the same indexes (not int)?

I have an array such as ['id' => 1, 'name' => 'Fred']. I want to call array_map on this array …

php arrays associative-array array-map
Can a method be used as an array_map function

I want to do something like this: class Cls { function fun($php) { return 'The rain in Spain.'; } } $ar = array(1,2,3); $…

php methods array-map
Select/map each item of a Powershell array to a new array

I have an array of file names in Powershell, and I would like to prepend a path to each of …

powershell higher-order-functions array-map
how to return nothing ( empty array) with array.map function

Right now, if 'Everything' in the list is detected, the output becomes [""]. Expected output: [] Copy.names = rule.names.map(function(…

javascript arrays array-map
What is the concept of Array.map?

I am having problems understanding the concept of Array.map. I did go to Mozilla and Tutorials Point, but they …

javascript jquery arrays mozilla array-map
PHP error. Why is "variable undefined" inside array_map?

I am using array_map function in my php application. I defined the array_map function like this. $ratingID = $this-&…

php arrays array-map
Call methods of objects in array using array_map?

Suppose I have simple class like: class MyClass { private $_prop; public function getProp() {return $this->_prop;} [....] } Now what I …

php arrays object methods array-map