Re: general questions
| From: | Markus Fischer | Date: | Wed, 28 Nov 2001 23:43:01 +0000 |
| Subject: | Re: general questions | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-3159@lists.php.net to get a copy of this message | ||
On Thu, Nov 29, 2001 at 12:20:11AM +0100, Markus Fischer wrote :
> On Wed, Nov 28, 2001 at 07:15:18PM -0000, Richard Heyes wrote :
> > > I still don't quite get the usage of "::" ..
> > > As far as I understand this is for so called static functions and to
> > > generate a new namespace ...
> > >
> > > So far so good
> > > But why do stuff like DB::connect ?
> > > Why not put stuff like that in a constructor?
> >
> > Because DB::connect() can return you a correct object type (ie mysql/pgsql).
>
> The constructor can do this too, but its currently a
> 'feature' and cannot be guaranteed to work in the future.
> Thats why we're using a static function for factoring the
> appropriate class.
Sorry to confuse everyone. Of course, constructors don't
return a value. What I meant was the '$this' variable inside
the constructor which can be modified. This, as writte
however, is a feature.
- Markus