Hi,

Glad to hear it was discussed. I understand you guys are busy and can't
just change things out of nowhere, but i wish it will be dropped in the
future.

It it gets dropped in the future i will come back and ask to make it
possible to call a static method and normal methods with the same name :P.
For now i will just wait.


Thx anyway,

*Carlos Rodrigues*

2014-12-01 15:25 GMT-02:00 Stanislav Malyshev <smalys...@gmail.com>:

> Hi!
>
> > class Cube {
> >  function weird() {
> >    echo Duck::foo();
> >  }
> >
> > }
> >
> > class Duck {
> >  public function foo() {
> >      echo 'My class is: ' . get_class($this);
> >  }
> > }
> >
> > $rubik = new Cube;
> > $rubik->weird(); // Output:  My class is: Cube
>
> This code produces:
>
> Deprecated: Non-static method Duck::foo() should not be called
> statically, assuming $this from incompatible context
>
> which informs you about the fact that what you're doing is wrong. This
> capability is kept for BC reasons. There was a discussion about dropping
> this from PHP 7 but it wasn't yet decided to remove the support. In any
> case, this has little to do with static and non-static functions having
> different namespaces.
>
> --
> Stas Malyshev
> smalys...@gmail.com
>

Reply via email to