Skip to content

Commit

Permalink
Fixing call-time pass by reference.
Browse files Browse the repository at this point in the history
  • Loading branch information
jperras committed Sep 26, 2009
1 parent bf551c2 commit 9a2cd88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cake/libs/set.php
Expand Up @@ -1163,10 +1163,10 @@ function apply($path, $data, $callback, $options = array()) {
$extracted = Set::extract($path, $data);

if ($options['type'] === 'map') {
$result = array_map($callback, &$extracted);
$result = array_map($callback, $extracted);

} elseif ($options['type'] === 'reduce') {
$result = array_reduce(&$extracted, $callback);
$result = array_reduce($extracted, $callback);

} elseif ($options['type'] === 'pass') {
$result = call_user_func_array($callback, array($extracted));
Expand Down

0 comments on commit 9a2cd88

Please sign in to comment.