"Christopher Fulton" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Not sure if this is the best way to do it or not, but you can do this
> and it should (untested code) work.....
>
> class Car {
>         function drive() {
>              return $this->getClassName();
>         }
>         function getClassName() {
>               return "Car";
>         }
> }
>
> class Porshe {
>          function getClassName() {
>               return "Porshe";
>          }
> }
>
> $foo = new Porshe();
> echo $foo->drive();

Of course this might work but it requires the definition of such a method in
*every* class I have.

Any more ideas?

Thanks in advance!

Torsten

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to