Permalink
Browse files

Fixing call-time pass by reference.

  • Loading branch information...
1 parent bf551c2 commit 9a2cd886fe6cda90fb758392e0bf19ecbc01bf0f @jperras jperras committed Sep 26, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 cake/libs/set.php
View
@@ -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));

0 comments on commit 9a2cd88

Please sign in to comment.