$username = 'Hadibut';
$email = 'hadibut@example.org';
$variables = compact('username', 'email');
// $variables is now ['username' => 'Hadibut', 'email' => 'hadibut@example.org']
This method is often used in frameworks to pass an array of variables between two components.