public static function isTrace(array $trace) { if (!Kint_Object::isSequential($trace)) { return false; } $any_required = array('file', 'line', 'args', 'class'); $file_found = false; foreach ($trace as $frame) { if (!is_array($frame) || !isset($frame['function'])) { return false; } if (!$file_found && isset($frame['file']) && file_exists($frame['file'])) { $file_found = true; } if (!array_intersect(array_keys($frame), $any_required)) { return false; } } return $file_found; }