First Draft
First Draft of the Example Files
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
$object = new Tiger();
|
||||
echo "Tigers have...<br>";
|
||||
echo "Fur: " . $object->fur . "<br>";
|
||||
echo "Stripes: " . $object->stripes;
|
||||
|
||||
class Wildcat
|
||||
{
|
||||
public $fur; // Wildcats have fur
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->fur = "TRUE";
|
||||
}
|
||||
}
|
||||
|
||||
class Tiger extends Wildcat
|
||||
{
|
||||
public $stripes; // Tigers have stripes
|
||||
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct(); // Call parent constructor first
|
||||
$this->stripes = "TRUE";
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user