PHP has evolved a lot in recent years but we still can't have a static and
a nonstatic function with the same name:

class A {
    function bla() { echo 'normal';  }
    static function bla() { echo 'static';  }
}

A::bla();

## ERROR: Cannot redeclare A::bla()

And also PHP supports calling static functions as if they were not static:

class B {
static function bla() { echo 'how come it works';  }
}

$object = new B;
$object->bla();


It confuses programmers that came from other languages, prevent APIs from
having meaningful names on static methods and have no other benefit than
supporting PHP 4 code.

I'd appreciate if anyone with sufficient knowledge/influence helped me
suggest this change to the maintainers.

IMHO, static and nonstatic functions should be "stored" in different
places. And if someone relies on this, one should use magic methods __call
and __callStatic instead.


Thanks for your time and patience,


Carlos Rodrigues
car...@jp7.com.br

Reply via email to