You're missing two ampersands...one on this line:
if($v = self::ransackArray($element, $needle))
which should be:
if($v = &self::ransackArray($element, $needle))
and one on this line:
$r = ransackArray($data, 'myTes');
which should be:
$r = &ransackArray($data, 'myTes');
(Note: it looks like your ransackArray
function is actually a method in a class, so if you're calling that method from within the class it would be $r = &$this->ransackArray($data, 'myTes');
)
When passing variables to a function, you don't need to use &
- just put the &
in front of the parameter in the function signature - but in cases like yours where you are getting a return value from a function, there needs to be a &
both in the function call and in the function signature. For more info see http://www.php.net/manual/en/language.references.pass.php