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
> -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
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
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
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
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
6 matches
Mail list logo