PHP - Classes and Objects
What will be the output of this PHP code?
<?php
class Car {
public $color;
public function __construct($color) {
$this->color = $color;
}
public function getColor() {
return $this->color;
}
}
$myCar = new Car('red');
echo $myCar->getColor();
?>