Re: Returning arrays from functions
| From: | Zak Greant | Date: | Tue, 05 Dec 2000 18:16:17 +0000 |
| Subject: | Re: Returning arrays from functions | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-40155@lists.php.net to get a copy of this message | ||
At 01:14 PM 12/5/00 -0500, Brendan W. McAdams wrote:
I notice it still isn't possible to directly return an array from a function; I find this rather annoying, as it makes heavy programming unwieldy at times. I'm wondering if this is a 'bug' or a 'feature' (is it because nobody has fixed function returns to allow arrays, or is it done on purpose?).Returning an array from a function works quite well. Please elaborate on your problem... perhaps I am misunderstanding what issue you are talking about. The following calls work function foo () {
return array ('bar', 'boo', 'baz');
}
$array = foo ();
list ($uno, $dos, $tres) = foo ();
--zak