note 64576 deleted from functions.returning-values by aharvey
| From: | aharvey@php.net | Date: | Wed, 05 Sep 2012 02:13:26 +0000 |
| Subject: | note 64576 deleted from functions.returning-values by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-190502@lists.php.net to get a copy of this message | ||
Note Submitter: Trevor Blackbird > yurab.com
----
You can also use the compact-extract pair to return multiple values:
<?php
function Composite($x, $y) {
$sum = $x + $y;
$dif = $x - $y;
return compact('sum', 'dif');
}
extract(Composite(3, 4));
echo $sum;
echo $dif;
?>