On 2011年4月26日星期二 at 上午10:31, David Muir wrote:
On 26/04/11 09:37, Ben Schmidt wrote:
> > > Back in PHP4 it was the only way to "simulate" an static call, but
> > > nowadays it really don't make sense at all.
> > >
> > > class Foo {
> > > static function toString(Bar $bar) {
> > > return 'Foo::toString($bar)';
> > > }
> > > function toString() {
> > > return '$this->toString()';
> > > }
> > > }
> > >
> > > $foo = new Foo();
> > > echo $foo->toString(); // instance
> > > echo Foo::toString(); // class
> > >
> > > PHP will complain about the 2nd method (can't redefine function) but
> > > for me
> > > are 2 completely different methods.
> > > I belive the current Object Model could be improved. isn't?
> >
> > I agree. Backward compatibility is the only reason to keep this. It's a
> > pretty compelling reason, though. It's hard to know how to phase it out
> > "non-invasively", too.
> >
> > Ben.
>
> Why not just deprecate it, and throw a E_STRICT warning? That's how
> we're dealing with all other future BC breaks.
+1 just like call non-static method statically did
>
>
> David
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>