Having issue with multiple calls of same view I am using the function views_get_view and it's working fine if am using this once in a function. But when I am calling this function multiple times with different arguments in the same function the result is going to lose. In that case, the result always be same as coming with first-time arguments. Following are my code.

 $viewname = "profile_match_with_job";
  $display_id = "block_3";
  $view = views_get_view($viewname);
  $view-&gt;set_display($display_id);
  $view-&gt;set_arguments(array(138,70)); // views Contextual filter parameters
  $view-&gt;pre_execute();
  $view-&gt;execute();
  $myresult =  $view-&gt;result;
// here $myresult array showing the correct result


But I am calling the same thing with dfferent argument then the result is not corrct like this

 $viewname = "profile_match_with_job";
  $display_id = "block_3";
  $view = views_get_view($viewname);
  $view-&gt;set_display($display_id);
  $view-&gt;set_arguments(array(138,80)); // views Contextual filter parameters
  $view-&gt;pre_execute();
  $view-&gt;execute();
  $myresult =  $view-&gt;result;
// here $myresult array showing the same result but in that case I have chnaged the param values from 138,70 to 138,80
Yes, this issue arises because you have a current copy of view and you not destroy it. Kindly use below code for multiple use (suggested to be every-time).

$viewname = "profile_match_with_job";
$display_id = "block_3";
$view = views_get_view($viewname);
$view-&gt;set_display($display_id);|
$view-&gt;set_arguments(array(138,80)); // views Contextual filter parameters
$view-&gt;pre_execute();
$view-&gt;execute();
$myresult =  $view-&gt;result;
$view-&gt;destroy();