At 1:08 PM -0500 2/25/08, Daniel Brown wrote:
On Sat, Feb 23, 2008 at 6:21 AM, Robert Cummings [EMAIL PROTECTED] wrote:
On Fri, 2008-02-22 at 18:13 -0500, tedd wrote:
He said your narratives, not your jokes. ;)
Besides, if you gave up programming and took up comedy, both
On Tue, 2008-02-26 at 10:32 -0500, tedd wrote:
At 1:08 PM -0500 2/25/08, Daniel Brown wrote:
On Sat, Feb 23, 2008 at 6:21 AM, Robert Cummings [EMAIL PROTECTED] wrote:
On Fri, 2008-02-22 at 18:13 -0500, tedd wrote:
He said your narratives, not your jokes. ;)
Besides, if you
On Tue, Feb 26, 2008 at 10:40 AM, Robert Cummings [EMAIL PROTECTED] wrote:
This reminds me of when I commented to a friend that I swim everyday
but still can't seem to lose the weight I want. He replied Look at
whales, they swim all the time and don't lose weight.
I understood his
From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC:
php-general@lists.php.net Date: Tue, 26 Feb 2008 10:40:34 -0500 Subject:
Re: [PHP] More than one values returned? On Tue, 2008-02-26 at 10:32
-0500, tedd wrote: At 1:08 PM -0500 2/25/08, Daniel Brown wrote: On
Sat, Feb 23, 2008 at 6
On Sat, Feb 23, 2008 at 6:21 AM, Robert Cummings [EMAIL PROTECTED] wrote:
On Fri, 2008-02-22 at 18:13 -0500, tedd wrote:
At 5:27 PM -0500 2/22/08, Robert Cummings wrote:
On Fri, 2008-02-22 at 17:04 -0500, Nathan Nobbe wrote:
and btw; your narratives are are just damned hilarious rob
On Fri, 2008-02-22 at 18:13 -0500, tedd wrote:
At 5:27 PM -0500 2/22/08, Robert Cummings wrote:
On Fri, 2008-02-22 at 17:04 -0500, Nathan Nobbe wrote:
and btw; your narratives are are just damned hilarious rob ;)
Take that Ted... I'm quitting my day job!! :)
Cheers,
Rob.
Robb: --
On Fri, 2008-02-22 at 09:50 -0600, Greg Donald wrote:
On 2/21/08, Nick Stinemates [EMAIL PROTECTED] wrote:
I'm glad you're literate enough to understand what *indication* and
*usually* mean.
I know perfectly well what they mean, both words in fact.
What I, and many others I can only
On 2/21/08, Nick Stinemates [EMAIL PROTECTED] wrote:
I'm glad you're literate enough to understand what *indication* and
*usually* mean.
I know perfectly well what they mean, both words in fact.
What I, and many others I can only assume, are waiting for, is one
shred of an example to back up
At 9:50 AM -0600 2/22/08, Greg Donald wrote:
On 2/21/08, Nick Stinemates [EMAIL PROTECTED] wrote:
-snip- for no importance
I am indeed waiting, where's your code? When, and under what
circumstances exactly, is getting back an array of objects from a
function or method call poor design ?
On Fri, 2008-02-22 at 13:09 -0500, tedd wrote:
At 9:50 AM -0600 2/22/08, Greg Donald wrote:
On 2/21/08, Nick Stinemates [EMAIL PROTECTED] wrote:
-snip- for no importance
I am indeed waiting, where's your code? When, and under what
circumstances exactly, is getting back an array of objects
On Fri, Feb 22, 2008 at 3:05 PM, Robert Cummings [EMAIL PROTECTED] wrote:
I for 1 think you're full of it :)
Don't be a 0. ;-P
--
/Dan
Daniel P. Brown
Senior Unix Geek
? while(1) { $me = $mind--; sleep(86400); } ?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
On Fri, 2008-02-22 at 15:11 -0500, Daniel Brown wrote:
On Fri, Feb 22, 2008 at 3:05 PM, Robert Cummings [EMAIL PROTECTED] wrote:
I for 1 think you're full of it :)
Don't be a 0. ;-P
I'm a 0 hero! :B
Cheers,
Rob.
--
..
|
On Fri, Feb 22, 2008 at 3:27 PM, Robert Cummings [EMAIL PROTECTED] wrote:
On Fri, 2008-02-22 at 15:11 -0500, Daniel Brown wrote:
On Fri, Feb 22, 2008 at 3:05 PM, Robert Cummings [EMAIL PROTECTED] wrote:
I for 1 think you're full of it :)
Don't be a 0. ;-P
I'm a 0 hero!
On Fri, 2008-02-22 at 15:29 -0500, Daniel Brown wrote:
On Fri, Feb 22, 2008 at 3:27 PM, Robert Cummings [EMAIL PROTECTED] wrote:
On Fri, 2008-02-22 at 15:11 -0500, Daniel Brown wrote:
On Fri, Feb 22, 2008 at 3:05 PM, Robert Cummings [EMAIL PROTECTED]
wrote:
I for 1 think you're
On Fri, Feb 22, 2008 at 3:36 PM, Robert Cummings [EMAIL PROTECTED] wrote:
On Fri, 2008-02-22 at 15:11 -0500, Daniel Brown wrote:
And I'm an L7.
With 0 percent success probability... once again 0 saves the day!!
Ouch. You hit me right in the feel-bads.
--
/Dan
Daniel P.
On Fri, 2008-02-22 at 15:36 -0500, Daniel Brown wrote:
On Fri, Feb 22, 2008 at 3:36 PM, Robert Cummings [EMAIL PROTECTED] wrote:
On Fri, 2008-02-22 at 15:11 -0500, Daniel Brown wrote:
And I'm an L7.
With 0 percent success probability... once again 0 saves the day!!
i for one have mixed feelings on this issue.
im tempted to agree w/ nick, but not entirely.
my stance is this; implementing the iterator or
related interfaces is transparent to client code;
namely you can still use for each to traverse the
collection.
you also get to do things during the
Robert Cummings wrote:
On Fri, 2008-02-22 at 15:11 -0500, Daniel Brown wrote:
On Fri, Feb 22, 2008 at 3:05 PM, Robert Cummings [EMAIL PROTECTED] wrote:
I for 1 think you're full of it :)
Don't be a 0. ;-P
I'm a 0 hero! :B
Cheers,
Rob.
My daughter called me her Zero Hero when she
On Fri, 2008-02-22 at 17:04 -0500, Nathan Nobbe wrote:
i for one have mixed feelings on this issue.
im tempted to agree w/ nick, but not entirely.
my stance is this; implementing the iterator or
related interfaces is transparent to client code;
namely you can still use for each to traverse
At 5:27 PM -0500 2/22/08, Robert Cummings wrote:
On Fri, 2008-02-22 at 17:04 -0500, Nathan Nobbe wrote:
and btw; your narratives are are just damned hilarious rob ;)
Take that Ted... I'm quitting my day job!! :)
Cheers,
Rob.
Robb: -- note the addition of an extra 'b' for my loss of a 'd'
On Fri, Feb 22, 2008 at 6:13 PM, tedd [EMAIL PROTECTED] wrote:
At 5:27 PM -0500 2/22/08, Robert Cummings wrote:
On Fri, 2008-02-22 at 17:04 -0500, Nathan Nobbe wrote:
and btw; your narratives are are just damned hilarious rob ;)
Take that Ted... I'm quitting my day job!! :)
Cheers,
On 2/19/08, Nick Stinemates [EMAIL PROTECTED] wrote:
I said, simply, returning an array of objects was usually an indication
of poor design.
No it's not. Nearly every MVC framework in existence implements some
sort of ActiveRecord finder that does exactly that.
Rails:
@foo = Foo.find( :all
Greg Donald wrote:
On 2/19/08, Nick Stinemates [EMAIL PROTECTED] wrote:
I said, simply, returning an array of objects was usually an indication
of poor design.
No it's not. Nearly every MVC framework in existence implements some
sort of ActiveRecord finder that does exactly
Nick Stinemates wrote:
Nathan Rixham wrote:
Robert Cummings wrote:
On Mon, 2008-02-18 at 21:09 -0600, Larry Garfield wrote:
On Monday 18 February 2008, Nick Stinemates wrote:
I have found, however, that if I ever need to return /multiple/
values,
it's usually because of bad design and/or
On Wed, Feb 20, 2008 at 1:38 AM, Robert Cummings [EMAIL PROTECTED]
wrote:
Actually, using foreach on an array has less overhead than an iterator
on an object.
yes they are; see my experiment results here,
http://nathan.moxune.com/arrayVsArrayIteratorReport.php
and i hear what youre saying
On Mon, Feb 18, 2008 at 9:06 PM, Nick Stinemates [EMAIL PROTECTED]
wrote:
Thats a good example, and a good reason for passing values by Reference
instead of by Value.
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
At 9:24 PM -0800 2/19/08, Nick Stinemates wrote:
Not once did I knock By Reference value passing or pointers.
I said, simply, returning an array of objects was usually an indication
of poor design.
And the difference between a variable, an object, an array, and a pointer is?
Look, they all
Jim Lucas wrote:
Nick Stinemates wrote:
Nathan Rixham wrote:
Robert Cummings wrote:
On Mon, 2008-02-18 at 21:09 -0600, Larry Garfield wrote:
On Monday 18 February 2008, Nick Stinemates wrote:
I have found, however, that if I ever need to return /multiple/
values,
it's usually because of
Nathan Nobbe wrote:
On Mon, Feb 18, 2008 at 9:06 PM, Nick Stinemates [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
Thats a good example, and a good reason for passing values by
Reference
instead of by Value.
I have found, however, that if I ever need to return
Nick Stinemates wrote:
Jim Lucas wrote:
Nick Stinemates wrote:
Nathan Rixham wrote:
Robert Cummings wrote:
On Mon, 2008-02-18 at 21:09 -0600, Larry Garfield wrote:
On Monday 18 February 2008, Nick Stinemates wrote:
I have found, however, that if I ever need to return /multiple/
values,
Robert Cummings wrote:
On Mon, 2008-02-18 at 21:09 -0600, Larry Garfield wrote:
On Monday 18 February 2008, Nick Stinemates 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.
You mean
At 6:06 PM -0800 2/18/08, Nick Stinemates wrote:
Thats a good example, and a good reason for passing values by Reference
instead of by Value.
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.
-Original Message-
From: Nathan Rixham [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 19, 2008 5:17 AM
To: php-general@lists.php.net
Subject: Re: [PHP] More than one values returned?
Robert Cummings wrote:
On Mon, 2008-02-18 at 21:09 -0600, Larry Garfield wrote:
On Monday 18
Nathan Rixham wrote:
Robert Cummings wrote:
On Mon, 2008-02-18 at 21:09 -0600, Larry Garfield wrote:
On Monday 18 February 2008, Nick Stinemates 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
On 2/18/08, Robert Cummings [EMAIL PROTECTED] wrote:
I'd just return arrays unless I had a specific need for incurring object
overhead for such simple datatypes.
w0rd.
--
Greg Donald
http://destiney.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
On 2/18/08, Nick Stinemates [EMAIL PROTECTED] 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,
At 4:57 PM -0600 2/19/08, Greg Donald wrote:
On 2/18/08, Nick Stinemates [EMAIL PROTECTED] 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
On Feb 19, 2008 5:23 PM, Steve Edberg [EMAIL PROTECTED] wrote:
For completeness sake, this is pretty much the same in PHP:
function test() {
return array(1,2);
}
list($a,$b) = test();
Yup, just a few more keystrokes is all.
--
Greg Donald
http://destiney.com/
--
PHP
Greg Donald wrote:
On 2/18/08, Nick Stinemates [EMAIL PROTECTED] 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
On Feb 19, 2008 9:27 PM, Nick Stinemates [EMAIL PROTECTED] wrote:
Support != good design habits.
So you presume to have better design habits than the many language
designers who implemented parallel assignment in their respective
language? Right.
On Feb 19, 2008 11:52 PM, Greg Donald [EMAIL PROTECTED] wrote:
On Feb 19, 2008 9:27 PM, Nick Stinemates [EMAIL PROTECTED] wrote:
Support != good design habits.
So you presume to have better design habits than the many language
designers who implemented parallel assignment in their
Nathan Nobbe wrote:
On Feb 19, 2008 11:52 PM, Greg Donald [EMAIL PROTECTED] wrote:
On Feb 19, 2008 9:27 PM, Nick Stinemates [EMAIL PROTECTED] wrote:
Support != good design habits.
So you presume to have better design habits than the many language
designers who implemented
On Tue, 2008-02-19 at 21:24 -0800, Nick Stinemates wrote:
I said, simply, returning an array of objects was usually an indication
of poor design.
Please elaborate as to the why of it being an indication of poor
design.
Cheers,
Rob.
--
Robert Cummings wrote:
On Tue, 2008-02-19 at 21:24 -0800, Nick Stinemates wrote:
I said, simply, returning an array of objects was usually an indication
of poor design.
Please elaborate as to the why of it being an indication of poor
design.
Cheers,
Rob.
I already did...
I
Robert Cummings wrote:
On Tue, 2008-02-19 at 21:51 -0800, Nick Stinemates wrote:
Robert Cummings wrote:
On Tue, 2008-02-19 at 21:24 -0800, Nick Stinemates wrote:
I said, simply, returning an array of objects was usually an indication
of poor design.
On Tue, 2008-02-19 at 21:51 -0800, Nick Stinemates wrote:
Robert Cummings wrote:
On Tue, 2008-02-19 at 21:24 -0800, Nick Stinemates wrote:
I said, simply, returning an array of objects was usually an indication
of poor design.
Please elaborate as to the why of it being an
On Tue, 2008-02-19 at 22:26 -0800, Nick Stinemates wrote:
Robert Cummings wrote:
On Tue, 2008-02-19 at 21:51 -0800, Nick Stinemates wrote:
Robert Cummings wrote:
On Tue, 2008-02-19 at 21:24 -0800, Nick Stinemates wrote:
I said, simply, returning an array of
On Feb 18, 2008, at 531PM, Teck wrote:
Is it possible to return more than one values in PHP?
Yes, in the form of an array.
return $x;
return $y;
Only one return statement can be used.
http://us.php.net/manual/en/functions.returning-values.php
Brady
--
PHP General Mailing List
You can't return more than one variable, but you can return an array that
contains multiple values.
$x = array('val1', 'val2');
return $x;
-TG
- Original Message -
From: Teck [EMAIL PROTECTED]
To: php-general@lists.php.net
Date: Tue, 19 Feb 2008 10:31:02 +0900
Subject: [PHP] More
On Monday 18 February 2008, Teck wrote:
Hi,
Is it possible to return more than one values in PHP?
return $x;
return $y;
They don't work for me.
-T
A function always returns a single value. That value can be an array.
function foo() {
return array(1, 2);
}
list($a, $b) = foo();
--
?php
$in = 4;
calcpows($in, $pow2, $pow4);
echo in = $in pow2=$pow2 pow4=$pow4;
// define return fields as $...
function calcpows($in, $pow2, $pow4)
{
$pow2 = $in * $in;
$pow4 = $pow2 * $pow2;
}
?
HTH
- Original Message -
From: Teck [EMAIL PROTECTED]
To: php-general@lists.php.net
C.R.Vegelin wrote:
?php
$in = 4;
calcpows($in, $pow2, $pow4);
echo in = $in pow2=$pow2 pow4=$pow4;
// define return fields as $...
function calcpows($in, $pow2, $pow4)
{
$pow2 = $in * $in;
$pow4 = $pow2 * $pow2;
}
?
HTH
Thats a good example, and a good reason for passing values
On Mon, 2008-02-18 at 18:06 -0800, Nick Stinemates wrote:
C.R.Vegelin wrote:
?php
$in = 4;
calcpows($in, $pow2, $pow4);
echo in = $in pow2=$pow2 pow4=$pow4;
// define return fields as $...
function calcpows($in, $pow2, $pow4)
{
$pow2 = $in * $in;
$pow4 = $pow2 * $pow2;
Robert Cummings wrote:
On Mon, 2008-02-18 at 18:06 -0800, Nick Stinemates wrote:
C.R.Vegelin wrote:
?php
$in = 4;
calcpows($in, $pow2, $pow4);
echo in = $in pow2=$pow2 pow4=$pow4;
// define return fields as $...
function calcpows($in, $pow2, $pow4)
{
$pow2 = $in * $in;
On Mon, 2008-02-18 at 18:29 -0800, Nick Stinemates wrote:
Robert Cummings wrote:
On Mon, 2008-02-18 at 18:06 -0800, Nick Stinemates wrote:
C.R.Vegelin wrote:
?php
$in = 4;
calcpows($in, $pow2, $pow4);
echo in = $in pow2=$pow2 pow4=$pow4;
// define return fields as
On Monday 18 February 2008, Nick Stinemates 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.
You mean you've never had a function like getCoordinates()? Or
getUsers(), or any
On Mon, 2008-02-18 at 21:09 -0600, Larry Garfield wrote:
On Monday 18 February 2008, Nick Stinemates 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.
You mean you've never
return an array
bastien From: [EMAIL PROTECTED] To: php-general@lists.php.net Date: Tue, 19
Feb 2008 10:31:02 +0900 Subject: [PHP] More than one values returned? Hi,
Is it possible to return more than one values in PHP? return $x;
return $y; They don't work for me. -T -- PHP General
58 matches
Mail list logo