Reply to Static Functions and Inheritance

Your name:

Reply:


Posted by Johannes Permoser on 01/24/08 21:48

Hi,

i have a class that calls a static function:

class Peter
{
static function foo() {echo 123;}

public static function bar ()
{
Peter::foo();
}
}

$p = new Peter();
$p->bar();

Now i want to extend the class and override the foo() function. However when
calling bar(), it will still execute the code defined in Peter and not the
override. I tried $this::foo(), but it doesn't work.

How can i solve this?

[Back to original 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

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