src/Map.php
public function rekey($expression)
    {
        $new = new static;

        $this->walk(function ($v, $k) use ($expression, $new) {
            $new_key = $this->call($expression, $v, $k);
            $new[$new_key] = $v;
        });

        return $new;
    }
public function rekey($expression)
    {
        $new = new static;

        $this->walk(function ($v, $k) use ($expression, $new) {
            $new_key = $this->call($expression, $v, $k);
            $new[$new_key] = $v;
        });

        return $new;
    }
public function rekey ( $ expression ) { $ new = new static ; $ this -> walk ( function ( $ v , $ k ) use ( $ expression , $ new ) { $ new_key = $ this -> call ( $ expression , $ v , $ k ) ; $ new [ $ new_key ] = $ v ; } ) ; return $ new ; }
Change the key for every element in the map using an expression to
calculate the new key.

```
$keyed_by_bytecode = new Map(count_chars('war of the worlds', 1));
$keyed_by_letter   = $keyed_by_bytecode->rekey('chr($_1)');
```

@param callable|string $expression
@return new static
@api
Change the key for every element in the map using an expression to calculate the new key .