Re: Re: Get name of extending class with static method call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Daniel Schierbeck wrote:
Christopher Fulton wrote:

This should work for you then....(maybe...i don't have php5 on my
system, so it may not, but i think it would.
http://us4.php.net/manual/en/function.get-class.php

class Car {
        function drive() {
             return get_class($this);
        }
 }

 class Porshe {
 }

$foo = new Porshe();
echo $foo->drive();


He needs a static function, ie Porche::drive()
PHP 5.1 does have support for $this in static objects though ;) but there's some special case because of which it has that... can't remember what or how. I might be off on this entirely though aswell :P

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux