00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00024
00025 function TIO_write($Str)
00026 {
00027 printf('%s',$Str);
00028 }
00029
00031 function TIO_writeln($Str)
00032 {
00033 printf("%s\n",$Str);
00034 }
00035
00037 class Animal{
00038 function Animal(){
00039 $this->setKind('animal');
00040 }
00041 function setKind($Kind){
00042 $this->kind = $Kind;
00043 }
00044 function call(){
00045 $speigel = $this->speigel;
00046 if (isset($speigel))
00047 $speigel = ' says "' . $speigel . '"';
00048 else
00049 $speigel = ' <undefined call>';
00050
00051 TIO_writeln($this->kind . $speigel);
00052 }
00053
00054 };
00055
00057 class Bird extends Animal{
00058 function Bird(){
00059 $this->setKind('bird');
00060 }
00061 };
00062
00064 class Pigeon extends Bird{
00065 function Pigeon(){
00066 $this->setKind('pigeon');
00067 $this->speigel = 'oh my poor toe Betty';
00068 }
00069 };
00070
00072 class RedKite extends Bird{
00073 function RedKite(){
00074 $this->setKind('red kite');
00075 $this->speigel = 'weee-ooo ee oo ee oo ee oo';
00076 }
00077 };
00078
00080 class Mammal extends Animal{
00081 };
00082
00084 class Cat extends Mammal{
00085 function Cat(){
00086 $this->setKind('cat');
00087 $this->speigel = 'meow';
00088 }
00089 };
00090
00092 class Dog extends Mammal{
00093 function Dog(){
00094 $this->setKind('dog');
00095 $this->speigel = 'woof';
00096 }
00097 };
00098
00099
00100 ?>