Re: [PHP] class attributes and __construct

2010-04-15 Thread Larry Garfield
On Thursday 15 April 2010 08:37:40 am Ashley Sheridan wrote: > I know I could move it to __construct and give it a default value in the > arguments list, but that brings it's own problems. What if the argument > list grows too big, and which attribute would be deemed more important > than another

RE: [PHP] class attributes and __construct

2010-04-15 Thread Tommy Pham
> -Original Message- > From: Fernando [mailto:ferna...@ggtours.ca] > Sent: Thursday, April 15, 2010 10:24 AM > To: php-general@lists.php.net > Subject: Re: [PHP] class attributes and __construct > > Hello Ashely, > > I would initialize the variable when I&#

Re: [PHP] class attributes and __construct

2010-04-15 Thread Fernando
5/04/2010 11:54, Ashley Sheridan wrote: On Thu, 2010-04-15 at 07:42 -0700, Tommy Pham wrote: Hi Ashley, -Original Message- From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] Sent: Thursday, April 15, 2010 6:38 AM To: PHP General List Subject: [PHP] class attributes and __con

RE: [PHP] class attributes and __construct

2010-04-15 Thread Ashley Sheridan
On Thu, 2010-04-15 at 07:42 -0700, Tommy Pham wrote: > Hi Ashley, > > > -Original Message- > > From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] > > Sent: Thursday, April 15, 2010 6:38 AM > > To: PHP General List > > Subject: [PHP] class attribu

RE: [PHP] class attributes and __construct

2010-04-15 Thread Tommy Pham
Hi Ashley, > -Original Message- > From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] > Sent: Thursday, April 15, 2010 6:38 AM > To: PHP General List > Subject: [PHP] class attributes and __construct > > I think this is probably going to end up as one of those

[PHP] class attributes and __construct

2010-04-15 Thread Ashley Sheridan
I think this is probably going to end up as one of those coders' preference type of things, but I was wondering what was considered the general best approach. When creating a class, you can define default values for the object in the class itself, and within the __construct function. Now, while I