Re: Problems with LSB
| From: | Moritz Bechler | Date: | Mon, 11 Feb 2008 13:03:46 +0000 |
| Subject: | Re: Problems with LSB | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-35371@lists.php.net to get a copy of this message | ||
-----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 extends A {
> }
>
> class C {
> function moo() {
> B::foo();
> }
> }
>
> B::foo(); // echos "B" - good
>
> $c = new C;
> $c->moo(); // echos "C" - wtf?? should be B
> ?>
>
> Is it a bug, or did I miss anything?
>
If you mark your function "foo" static - as you should - its "BB" for me.
Moritz Bechler
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHsEeydLVsKnwBr9YRAu8LAJ4+/pnKZ1YzM0wN9k7Vg9eyWaZnUQCeKTrO
hgv4dRz1YtLqHRgagUOKwQA=
=cxLj
-----END PGP SIGNATURE-----