Re: general questions
| From: | Markus Fischer | Date: | Wed, 28 Nov 2001 23:20:11 +0000 |
| Subject: | Re: general questions | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-3158@lists.php.net to get a copy of this message | ||
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.
- Markus