I'm new to PHP and I am trying to follow a course.
<?php
class myCar {
function myCar() {
$this->model = "Sports";
}
}
$Range_Rover = new myCar();
echo $Range_Rover->model;
?>
According to the tutorial I should get the output "Sports" What is causing the code to result in an error of undefined property?
Warning: Undefined property: myCar::$model in C:\xampp\htdocs\Test\index.php on line 16
Screenshot of tutorial results
Many thanks, Stuart