Re: [PHP-DEV] Static functions Vs Nonstatic functions

2014-12-01 Thread Andrea Faulds
> 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

Re: [PHP-DEV] Static functions Vs Nonstatic functions

2014-12-01 Thread Carlos Rodrigues
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 :

Re: [PHP-DEV] Static functions Vs Nonstatic functions

2014-12-01 Thread Stanislav Malyshev
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

Re: [PHP-DEV] Static functions Vs Nonstatic functions

2014-12-01 Thread Carlos Rodrigues
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

Re: [PHP-DEV] Static functions Vs Nonstatic functions

2014-11-28 Thread Stanislav Malyshev
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

Re: [PHP-DEV] Static functions Vs Nonstatic functions

2014-11-28 Thread Marc Bennewitz
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-DEV] Static functions Vs Nonstatic functions

2014-11-28 Thread Carlos Rodrigues
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