correct code would be
<?php
class Shape
{
public $sides = 0;
public $name = " ";
public function __construct(string $name, int $sides)
{ //defining a constructor
$this->sides = $sides; //initializing $this->sides to $sides
$this->name = $name; //initializing $this->name to $name
}
public function description()
{ //method to display name and sides of a shape
echo "A $this->name with $this->sides sides.";
}
}
$myShape = new Shape("hexagon", 6, $myShape->description);
?>
Course: https://www.educative.io/collection/10370001/5669965877215232
Lesson: https://www.educative.io/collection/page/10370001/5669965877215232/5646368521584640