TIP: Use Markdown or, <pre> for multi line code blocks / <code> for inline code.
These forums are read-only and for archival purposes only!
Please join our new forums at discourse.kohanaframework.org
Arr::map doesn't correctly work with multidimensional arrays whithin given $keys
  • I don't know exactly whether this is a bug or a feature. But when I'm using Arr:map for multidimensional array like this

    Array ( [user] => Array ( [add] => some ) [test] => test )

    And when I want to apply some function with $keys = array ('add'), it has been applied to all items! I mean if some of key is located beneath the first layer it is ignored. This happens because of this line (SYSPATH/classes/kohana/arr.php, 372): $array[$key] = Arr::map($callback, $array[$key]);

    I think it should've been changed to $array[$key] = Arr::map($callback, $array[$key], $keys);

    Am I right?

    P. S. Sorry for my bad English