Skip to content

Instantly share code, notes, and snippets.

@maks-rafalko
Last active October 1, 2018 18:23
Show Gist options
  • Save maks-rafalko/2a06406a5bc4293edcc6bd7237af44b1 to your computer and use it in GitHub Desktop.
Save maks-rafalko/2a06406a5bc4293edcc6bd7237af44b1 to your computer and use it in GitHub Desktop.
// array_map
- $lowercasedStrings = array_map(['P', 'H', 'P'], function ($v) {
- return strtolower($v);
- });
+ $lowercasedStrings = ['P', 'H', 'P'];
// array_filter
- $evenNumbers = array_filter([1, 2, 3, 4], function ($v) {
- return $v % 2;
- });
+ $evenNumbers = [1, 2, 3, 4];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment