Are constructors inherited or belong to the class in which they are defined? I just saw examples with subclass constructors that call superclass constructors. This is my current code, which may give some hint of what is happening. (I will modify the code according to your answers. If I can use the superclass constructor, I will not define a constructor for each subclass and call the superclass constructor from each.
abstract class view
{
public $vieverid;
function __construct($viewerid) {
$this->viewer = $viewerid;
}
}
class viewactor extends view{
function __construct($viewerid) {
$this->viewerid = $viewerid;
}
source
share