Классы / Наследование

<?php

class Shape {
    public $lineCount = 0;

    function __construct($lineCount) {
        $this->lineCount = $lineCount;
    }
}

class Square extends Shape {
    public $sideLength = 0

    function __construct($sideLength) {
        parent::__construct(4);
        $this->sideLength = $sideLength;
    }
}

$square = new Square(5);
//square.lineCount is 4

echo $square->lineCount;