I have an abstract class implementing an interface. This abstract class doesn't contain all of the methods required by the interface. I have a second class that inherits from the first one and contains the missing methods. The code produces no error, but doesn't work.
Simple examle:
Code: Select all
<?php
interface MyInterface {
public function printTest();
}
abstract class A
implements MyInterface {
protected $testString = "Hello world";
}
class B
extends A{
public function printTest() {
echo($testString);
}
}
$obj = new B();
$obj->printTest();
?>Lars
feyd | Help us, help you. Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]