Created
March 21, 2011 16:15
-
-
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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