I think your problem has to do with the recursive part:
if (is_array($value) || is_object($value)) {
$this->search_objects($value);
}
You probably want to do something with the return value. Like: if ($this->search_objects($value)) return true;
(Then again, I'm not sure what you are trying to accomplish)
edit: Try this:
function search_objects($objects)
{
$filters = array('word', 'test');
foreach ($objects as $key => $value) {
if (is_array($value) || is_object($value)) {
if ($this->search_objects($value)) {
return true;
}
} else {
//look for faulty strings in value
foreach ($filters as $filter) {
if (!is_int($value) && strpos($value, $filter) !== false) {
return true;
}
}
}
}
return false;
}