Re: Static and non-static methods
| From: | Derick Rethans | Date: | Fri, 04 Apr 2003 15:31:41 +0000 |
| Subject: | Re: Static and non-static methods | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-666@lists.php.net to get a copy of this message | ||
On Fri, 4 Apr 2003, Sterling Hughes wrote:
> On Fri, 2003-04-04 at 09:52, Andrei Zmievski wrote:
> > What does everyone think about disallowing non-instance calls to methods
> > which are not declared static? Currently, this works:
> >
> > class A {
> > function B() { return 1; }
> > }
> >
> > A::B();
> >
> > But really, if B was intended to be used that way, it should have been
> > declared as static.
> >
>
> Well its a BC nightmare, and I don't really see any big advantage.
Agreed, breaking BC for this sounds like a bad idea to me.
Derick
--
"my other box is your windows PC"
-------------------------------------------------------------------------
Derick Rethans http://derickrethans.nl/
PHP Magazine - PHP Magazine for Professionals http://php-mag.net/
-------------------------------------------------------------------------