document.write("
<?php
class Car {
//properties
public $price;
public $colour;
//constructor
function __construct($myPrice = 60000, $myColour = "White"){
$this->price = $myPrice;
$this->colour = $myColour;
}
//methods
function getPrice(){
return $this->price;
}
function getColour(){
return $this->colour;
}
}
//start the build process
$myCar = new Car();
echo $myPrice = $myCar->getPrice();
echo $myColour = $myCar->getColour();
oop8 - Snippet hosted by \"Cacher\"
");