How php compact function is usefull for mvc frameworks

<?php
$firstname = "Karthikeyan";
$lastname = "Manivasagam";
$age = "27";

$name = array("firstname", "lastname");
$result = compact($name, "location", "age");

print_r($result);
?>
Output 

Array ( [firstname] => Karthikeyan [lastname] => Manivasagam [age] => 27 )

How php compact function is usefull for mvc frameworks ? let me tell you

We could use the same method when we pass/set  variables to views in controller

$anything = "something";
$this->view->render("viewname" , compact('anything'));