Skip to content

Instantly share code, notes, and snippets.

@andrewbredow
Created March 21, 2011 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewbredow/879708 to your computer and use it in GitHub Desktop.
Save andrewbredow/879708 to your computer and use it in GitHub Desktop.
PHP has a really stupid way to access keys when mapping a function to an array
// This works
array_map(function($key, $value) {
var_dump($key);
var_dump($value);
}, array_keys($someArray), $someArray);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment