You are here: Re: [PHP] Re: Get name of extending class with static method call « PHP « IT news, forums, messages
Re: [PHP] Re: Get name of extending class with static method call

Posted by M. Sokolewicz on 10/06/95 11:05

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация