RE: [PHP-DEV] Returning arrays from functions
| From: | Chris Newbill | Date: | Tue, 05 Dec 2000 18:16:57 +0000 |
| Subject: | RE: [PHP-DEV] Returning arrays from functions | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-40156@lists.php.net to get a copy of this message | ||
I do this all the time, in fact I even return multi-dimension arrays too.
<?php
$a = array("Goodbye", "Cruel", "World");
function getArray ( $ar )
{
return $ar;
}
var_dump(getArray($a));
?>
==== OUTPUT =====
array(3) { [0]=> string(7) "Goodbye" [1]=> string(5) "Cruel" [2]=>
string(5)
"World" }
Chris
-----Original Message-----
From: Brendan W. McAdams [mailto:bmcadams@scalabletech.com]
Sent: Tuesday, December 05, 2000 11:14 AM
To: php-dev@lists.php.net
Subject: [PHP-DEV] Returning arrays from functions
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?).
-Brendan
-----
Brendan W. McAdams | email:
bmcadams@scalabletech.com
Web Developer, Scalable Technologies | web: www.scalabletech.com
"Always listen to the experts; they'll tell you what can't be done, and why.
Then do it."
- Robert A. Heinlein
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
For additional commands, e-mail: php-dev-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net