Re: More than one values returned?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/18/08, Nick Stinemates <nick@xxxxxxxxxxxxxx> wrote:
> I have found, however, that if I ever need to return /multiple/ values,
> it's usually because of bad design and/or the lack of proper encapsulation.

Yeah, that's probably why most popular scripting languages support it.

In Ruby:

def foo
  1, 2
end

a, b = foo


In Python:

def foo
  return 1, 2

a, b = foo


In Perl:

sub foo
{
  return (1, 2);
}

(my $a, my $b) = foo;



--
Greg Donald
http://destiney.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux