Re: [PHP-DEV] Problems with LSB

2008-02-17 Thread Jingcheng Zhang
Hello Etienne, If static:: in static context behaves like $this in object context, it would be much meaningful. If we introduce the meta class concept in PHP, then each class is an instance of the meta class, thus we can treat a class as an object, and then it is natural that static members

Re: [PHP-DEV] Problems with LSB

2008-02-11 Thread Moritz Bechler
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 My original reply missed the list :| Hi, i've written the following code using Etiennes LSB. But I'm facing some problems. ?php class A { function foo() { echo get_called_class(); } } class B

Re: [PHP-DEV] Problems with LSB

2008-02-11 Thread Sebastian Deutsch
Hello, that's it. Even $b = new B; $b-foo(); // echos B - good works. Thank you! *.sebastian Sebastian Deutsch schrieb: Hello, care... my case is slightly different. I was aware of that problem, but in my case I call B::foo() from the main scope - it behaves right - when I call it

Re: [PHP-DEV] Problems with LSB

2008-02-11 Thread Sebastian Deutsch
Hello, care... my case is slightly different. I was aware of that problem, but in my case I call B::foo() from the main scope - it behaves right - when I call it within the scope of C (same call) it behaves different. This is different as described in the bug. The same call should have the same

Re: [PHP-DEV] Problems with LSB

2008-02-11 Thread Lokrain
Hello, Sebastian This seems to be a known bug http://bugs.php.net/bug.php?id=43408 and in fact already assigned. Fallbacks occur in static/self calls, as static/self resolve to foo and it returns foo as expected. However, when you do a parent::demo() you actually call bar::demo(), which is

[PHP-DEV] Problems with LSB

2008-02-11 Thread Etienne Kneuss
Hello, your foo function is not defined as static, hence no static call is done. Strict Standards: Non-static method A::foo() should not be called statically, assuming $this from incompatible context ... Define your method as static and it should work just fine. Regards On Feb 11, 2008

[PHP-DEV] Problems with LSB

2008-02-10 Thread Sebastian Deutsch
Hello, i've written the following code using Etiennes LSB. But I'm facing some problems. ?php class A { function foo() { echo get_called_class(); } } class B extends A { } class C { function moo() { B::foo(); }