Re: [PHP-DEV] Call non-static method staticly raise E_STRICT, but why call a static method instancely won't

2011-04-25 Thread reeze
On 2011年4月26日星期二 at 上午10:31, David Muir wrote: On 26/04/11 09:37, Ben Schmidt wrote: > > > Back in PHP4 it was the only way to "simulate" an static call, but > > > nowadays it really don't make sense at all. > > > > > > class Foo { > > > static function toString(Bar $bar) { > > > return 'Foo::to

Re: [PHP-DEV] Call non-static method staticly raise E_STRICT, but why call a static method instancely won't

2011-04-25 Thread David Muir
On 26/04/11 09:37, Ben Schmidt wrote: >> Back in PHP4 it was the only way to "simulate" an static call, but >> nowadays it really don't make sense at all. >> >> class Foo { >> static function toString(Bar $bar) { >>return 'Foo::toString($bar)'; >> } >> function toStrin

Re: [PHP-DEV] Call non-static method staticly raise E_STRICT, but why call a static method instancely won't

2011-04-25 Thread Ben Schmidt
Back in PHP4 it was the only way to "simulate" an static call, but nowadays it really don't make sense at all. class Foo { static function toString(Bar $bar) { return 'Foo::toString($bar)'; } function toString() { return '$this->toString()'; } } $foo

Re: [PHP-DEV] Call non-static method staticly raise E_STRICT, but why call a static method instancely won't

2011-04-25 Thread Richard Quadling
On 25 April 2011 11:29, Reindl Harald wrote: > nobody says "stop selling guns because somebody can shoot in his foot" It'd be a place to start though. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- PHP Internals - PHP Runtime Development Mailing

Re: [PHP-DEV] Call non-static method staticly raise E_STRICT, but why call a static method instancely won't

2011-04-25 Thread Martin Scotta
Martin Scotta On Mon, Apr 25, 2011 at 4:52 AM, Alessandro Nadalin < alessandro.nada...@gmail.com> wrote: > 2011/4/24 Etienne Kneuss : > > Hi, > > > > On Apr 24 22:13:47, Ángel González wrote: > >> reeze wrote: > >> > Hi, > >> > I am not sure it's the right place to discuss this. someday I found

Re: [PHP-DEV] Call non-static method staticly raise E_STRICT, but why call a static method instancely won't

2011-04-25 Thread Reindl Harald
Am 25.04.2011 13:17, schrieb Alessandro Nadalin: > peacefully talking, no need to be such aggressive nobody is aggressive, maybe it sounds do for you because english is not my native language and it is not always easy to make a position clear in a foreign language in the same way as in the nati

Re: [PHP-DEV] Call non-static method staticly raise E_STRICT, but why call a static method instancely won't

2011-04-25 Thread Alessandro Nadalin
Hi Harald, >> >> I can see your point, but I think we should drop this "feature" not to >> let developers have N ways of doing the same things: > > why should ANYTHING be dropped affection backward compatibility? > >> if you declare a method as static, you should be able to only call it >> with a

Re: [PHP-DEV] Call non-static method staticly raise E_STRICT, but why call a static method instancely won't

2011-04-25 Thread Reindl Harald
Am 25.04.2011 09:52, schrieb Alessandro Nadalin: >> Nothing wrong with it. >> >> The E_STRICT is raised because when you call a non-static method >> statically, $this will not be defined and that could be a problem (e.g. >> the method could rely on it). When you call a static method with ->, it >

Re: [PHP-DEV] Call non-static method staticly raise E_STRICT, but why call a static method instancely won't

2011-04-25 Thread Alessandro Nadalin
2011/4/24 Etienne Kneuss : > Hi, > > On Apr 24 22:13:47, Ángel González wrote: >> reeze wrote: >> > Hi, >> > I am not sure it's the right place to discuss this. someday I found I call >> > a static method _instancely_. >> > the method is just a helper method when reviewing my code. I know I do the