> On 1 Dec 2014, at 19:48, Carlos Rodrigues wrote:
>
> 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.
Can’t be done. It’s important for inheritance that you can call me
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 :
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 m
Hi Stanislav.
Thank you for replying. I agree that PHP can be different from other
languages, but i think you agree that a code like this just feels wrong:
class Cube {
function weird() {
echo Duck::foo();
}
}
class Duck {
public function foo() {
echo 'My class is: ' . get_class($thi
Hi!
> 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 think this notion of "confuses programmers" sometimes goes too far,
and this is one of the examples. PHP prides its
Please read :
http://grokbase.com/t/php/php-internals/14acs23cpe/disallow-non-static-method-calls-with-self-static-in-php-7#20141026ct1np9k82bte2m9k9rtmq1c2jr
Am 28.11.2014 um 20:29 schrieb Carlos Rodrigues:
PHP has evolved a lot in recent years but we still can't have a static and
a nonstati
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