Re: [PHP] Object Inheritance, get_class() and a static function call

2005-07-27 Thread Jochem Maas
axel wrote: Hello Jochem, > Axel lets start again. Okay. > SO: explain, please, why and what you are trying to do (DETAILS!). > don't dumb it down because that just makes the problem look moot. I need the classname to register variables in the session. It's complicated. There are a lot

Re: [PHP] Object Inheritance, get_class() and a static function call

2005-07-27 Thread axel
Hello Jochem, > Axel lets start again. Okay. > SO: explain, please, why and what you are trying to do (DETAILS!). > don't dumb it down because that just makes the problem look moot. I need the classname to register variables in the session. It's complicated. There are a lot of inheritences

Re: [PHP] Object Inheritance, get_class() and a static function call

2005-07-27 Thread Jochem Maas
axel wrote: Hello Jochem, Axel lets start again. you seem to want to write a method in 1 base class that will give you the correct classname when you call the method statically on the/a subclass) ... In all cases It _seems_ to me that you must already know the name of the class in order to ge

Re: [PHP] Object Inheritance, get_class() and a static function call

2005-07-26 Thread axel
Hello Jochem, either you tested some different code to what you posted above OR (your build of?) 5.0.3 is borked. sorry, I didn't tested the code at all, because my code is more complex. I just tried to show the problem. class ClassA { public static function getClassName() { return

Re: [PHP] Object Inheritance, get_class() and a static function call

2005-07-26 Thread axel
Hello Richard, thanks for for your answer. a> class ClassA { a>function getClassName() { a> return get_class($this); # [1] a>} a> } a> class ClassB extends ClassA { } a> echo ClassB::getClassName(); a> this script echoes "Object" instead of "ClassB". but i would like to a> return

Re: [PHP] Object Inheritance, get_class() and a static function call

2005-07-26 Thread Jochem Maas
axel wrote: Hello, following code won't work in the expected way: class ClassA { function getClassName() { return get_class($this); # [1] } } class ClassB extends ClassA { } echo ClassB::getClassName(); this script echoes "Object" instead of "ClassB". but i would like to either you

Re: [PHP] Object Inheritance, get_class() and a static function call

2005-07-26 Thread Richard Davey
Hello axel, Tuesday, July 26, 2005, 8:02:05 PM, you wrote: a> class ClassA { a>function getClassName() { a> return get_class($this); # [1] a>} a> } a> class ClassB extends ClassA { } a> echo ClassB::getClassName(); a> this script echoes "Object" instead of "ClassB". but i would like

[PHP] Object Inheritance, get_class() and a static function call

2005-07-26 Thread axel
Hello, following code won't work in the expected way: class ClassA { function getClassName() { return get_class($this); # [1] } } class ClassB extends ClassA { } echo ClassB::getClassName(); this script echoes "Object" instead of "ClassB". but i would like to return the classname of th