A recursive version of array_map() function

@param     callback   Callback function to apply
@param     mixed      Input array
@return    array with callback applied
493917
protected function arrayMapRecursive($callback, $arr)
    {
        if (!is_array($arr)) {
            return call_user_func($callback, $arr);
        }
        $mapped = array();
        foreach ($arr as $k => $v) {
            $mapped[$k] = is_array($v)?
                          $this->arrayMapRecursive($callback, $v):
                          call_user_func($callback, $v);
        }
        return $mapped;
    }
345869
public function map($callback, $in_place = false)
    {
        if (!is_callable($callback)) {
            throw new \InvalidArgumentException('ItemList::map() expects a callable argument.');
        }

        $mapped = array_map($callback, $this->list);

        if ($in_place) {
            $this->list = $mapped;

            return $this;
        }

        return new ItemList($mapped);
    }
631205
final public function map(Callable $callback)
	{
		$arr = array_map(
			$callback,
			array_values($this->{self::MAGIC_PROPERTY}),
			array_keys($this->{self::MAGIC_PROPERTY})
		);
		return static::createFromArray($arr);
	}
291568
public static function map($collection, $callback)
    {
        self::assert_callable($callback);

        $result = [];

        foreach ($collection as $key => $value) {
            $result[$key] = $callback($value, $key, $collection);
        }

        return $result;
    }
1046896
public function sort(callable $callback = null) : ArrayList
    {
        $values = $this->_sort($callback);
        $this->setValues($values);
        return $this;
    }
1189696
public function map(callable $callback)
    {
        $result = array();

        foreach ($this->nodes as $index => $node) {
            $return_value = \call_user_func($callback, $node, $index);

            if ($return_value === null) {
                continue;
            } elseif (\is_array($return_value)) {
                $result = \array_merge($result, $return_value);
            } else {
                $result[] = $return_value;
            }
        }

        return $result;
    }
1110130
public function map(callable $callback = null)
	{
		return $callback ? array_map($callback, $this->list) : $this->list;
	}
669230
function(callback) {
      var i = 0,
          keys = this.keys(),
          returned;

      for (i; i < keys.length; i++) {
        returned = callback(keys[i], this.get(keys[i]));
        if (returned === false) { return false; }
      };
    }
119265
public function indexBy($callback)
    {
        $keys = array_map($callback, $this->value);
        $value = array_combine($keys, $this->value);
        return $this->setValue($value);
    }
802004
private static function array_recursive(&$array, $function, $apply_to_keys_also = false) {
		foreach ( $array as $key => $value ) {
			if (is_array ( $value )) {
				self::array_recursive ( $array [$key], $function, $apply_to_keys_also );
			} else {
				$array [$key] = $function ( $value );
			}

			if ($apply_to_keys_also && is_string ( $key )) {
				$new_key = $function ( $key );
				if ($new_key != $key) {
					$array [$new_key] = $array [$key];
					unset ( $array [$key] );
				}
			}
		}
	}
271197
public function groupBy($callback)
    {
        $group = new Map();
        foreach ($this as $value) {
            $key = $callback($value);
            if (!$group->containsKey($key)) {
                $element = $this instanceof VectorInterface ? new static([$value]) : new Vector([$value]);
                $group->add(new Pair($key, $element));
            } else {
                $value = $group->get($key)->add($value);
                $group->set($key, $value);
            }
        }

        return $group;
    }
1066566
public function map($callback) : ArrayList
    {
        $values = $this->_map($callback);
        $this->setValues($values);
        return $this;
    }
953948
protected function _bind(array $callback) {
		if (true === empty($callback)) {
			return false;
		}
		array_map(function ($cb) {
			parent::on($cb['event'], $cb['callback']);
		}, $callback);
	}
932211
public function map($callback) {

      if (!is_callable($callback)) {
        throw new \InvalidArgumentException('Invalid callback function');
      }

      foreach ($this->getItems() as $index => $item) {
        call_user_func_array($callback, array($item, $index, $this));
      }

      $this->rewind();

      return $this;
    }
1024553
public static function map(array $arr, callable $callback): array
    {
        $arrResult = [];

        foreach ($arr as $index => $value) {
            $arrResult[] = $callback($value, $index);
        }

        return $arrResult;
    }
177261
public function map(callable $callback): Map
    {
        $apply = function($pair) use ($callback) {
            return $callback($pair->key, $pair->value);
        };

        return new self(array_map($apply, $this->pairs));
    }
739631
public static function array_map_recursive($function, array $array)
    {
        $tmp = array();

        foreach ($array as $key => $value) {
            if (is_array($value)) {
                $tmp[$key] = self::array_map_recursive($function, $value);
            } else {
                $tmp[$key] = call_user_func($function, $value);
            }
        }

        return $tmp;
    }