hvle Posted May 24, 2006 Share Posted May 24, 2006 class c1{ virtual function func1(); }class c2 extends c1{ function func1() { // actual works done here }}Is this kind of structure possible in PHP? Quote Link to comment https://forums.phpfreaks.com/topic/10313-virtual-function-in-php/ Share on other sites More sharing options...
trq Posted May 24, 2006 Share Posted May 24, 2006 Yes. Quote Link to comment https://forums.phpfreaks.com/topic/10313-virtual-function-in-php/#findComment-38470 Share on other sites More sharing options...
hvle Posted May 24, 2006 Author Share Posted May 24, 2006 [!--quoteo(post=376569:date=May 24 2006, 03:09 PM:name=thorpe)--][div class=\'quotetop\']QUOTE(thorpe @ May 24 2006, 03:09 PM) [snapback]376569[/snapback][/div][div class=\'quotemain\'][!--quotec--]Yes.[/quote]How, would be great. Quote Link to comment https://forums.phpfreaks.com/topic/10313-virtual-function-in-php/#findComment-38479 Share on other sites More sharing options...
trq Posted May 24, 2006 Share Posted May 24, 2006 If I understand where your going... something like....[code]abstract class1 { public abstract function foo() {}}class2 impliments class1 { public function foo() { return true; }}[/code] Quote Link to comment https://forums.phpfreaks.com/topic/10313-virtual-function-in-php/#findComment-38486 Share on other sites More sharing options...
hvle Posted May 24, 2006 Author Share Posted May 24, 2006 [!--quoteo(post=376586:date=May 24 2006, 04:31 PM:name=thorpe)--][div class=\'quotetop\']QUOTE(thorpe @ May 24 2006, 04:31 PM) [snapback]376586[/snapback][/div][div class=\'quotemain\'][!--quotec--]If I understand where your going... something like....[code]abstract class1 { public abstract function foo() {}}class2 impliments class1 { public function foo() { return true; }}[/code][/quote]strangely, I couldn't find any information relate to 'abstract' in the manual. There is very vague documentaion of class and OOP in PHP manual. I've found an alternative to this problem, but thanks for the info. I hope there'll be more 'doc' on this issue in the next version. Quote Link to comment https://forums.phpfreaks.com/topic/10313-virtual-function-in-php/#findComment-38494 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.