note 64576 added to functions.returning-values
| From: | TrevorBlackbirdyurab dot com at osu1 dot php dot net | Date: | Tue, 18 Apr 2006 23:36:55 +0000 |
| Subject: | note 64576 added to functions.returning-values | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-108458@lists.php.net to get a copy of this message | ||
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;
?>
----
Server IP: 216.235.15.211
Probable Submitter: 67.71.49.113
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/functions.returning-values.php
Edit -- http://master.php.net/note/edit/64576
Del: integrated -- http://master.php.net/note/delete/64576/integrated
Del: useless -- http://master.php.net/note/delete/64576/useless
Del: bad code -- http://master.php.net/note/delete/64576/bad+code
Del: spam -- http://master.php.net/note/delete/64576/spam
Del: non-english -- http://master.php.net/note/delete/64576/non-english
Del: in docs -- http://master.php.net/note/delete/64576/in+docs
Del: other reasons-- http://master.php.net/note/delete/64576
Reject -- http://master.php.net/note/reject/64576
Search -- http://master.php.net/manage/user-notes.php