Re: [PHP-DEV] disallow non-static method calls with self/static in PHP 7

2014-10-28 Thread Julien Pauli
On Sun, Oct 12, 2014 at 12:10 PM, Nikita Popov wrote: > On Sun, Oct 12, 2014 at 10:37 AM, Robert Stoll wrote: > >> Hey, >> >> >> >> I just stumbled over a method call of a non-static method with self and >> was asking myself again, why does PHP support >> this behaviour. An example to outline wh

Re: [PHP-DEV] disallow non-static method calls with self/static in PHP 7

2014-10-27 Thread Chris Wright
On 26 October 2014 19:55, Marc Bennewitz wrote: > > On 12.10.2014 12:10, Nikita Popov wrote: > > On Sun, Oct 12, 2014 at 10:37 AM, Robert Stoll wrote: > > > >> Hey, > >> > >> > >> > >> I just stumbled over a method call of a non-static method with self and > >> was asking myself again, why does

Re: [PHP-DEV] disallow non-static method calls with self/static in PHP 7

2014-10-26 Thread Marc Bennewitz
On 12.10.2014 12:10, Nikita Popov wrote: > On Sun, Oct 12, 2014 at 10:37 AM, Robert Stoll wrote: > >> Hey, >> >> >> >> I just stumbled over a method call of a non-static method with self and >> was asking myself again, why does PHP support >> this behaviour. An example to outline what I am writi

Re: [PHP-DEV] disallow non-static method calls with self/static in PHP 7

2014-10-12 Thread Nikita Popov
On Sun, Oct 12, 2014 at 10:37 AM, Robert Stoll wrote: > Hey, > > > > I just stumbled over a method call of a non-static method with self and > was asking myself again, why does PHP support > this behaviour. An example to outline what I am writing of: > > > > class A{ > > function foo(){ > >

AW: [PHP-DEV] disallow non-static method calls with self/static in PHP 7

2014-10-12 Thread Robert Stoll
> In your given example, $this is defined when A::bar() is called; > interestingly, when this class is extended it will still only call > A::bar() as opposed to calling $this->bar(). Whether this is useful behaviour > is irrelevant :) > Right, I completely forgot that. So calling it with self

Re: [PHP-DEV] disallow non-static method calls with self/static in PHP 7

2014-10-12 Thread Tjerk Meesters
On 12 Oct 2014, at 16:37, Robert Stoll wrote: > Hey, > > > > I just stumbled over a method call of a non-static method with self and was > asking myself again, why does PHP support > this behaviour. An example to outline what I am writing of: > > > > class A{ > > function foo(){ > >

[PHP-DEV] disallow non-static method calls with self/static in PHP 7

2014-10-12 Thread Robert Stoll
Hey, I just stumbled over a method call of a non-static method with self and was asking myself again, why does PHP support this behaviour. An example to outline what I am writing of: class A{ function foo(){ self::bar(); } function bar(){} } IMO it should not be allowed