Inheritance/Single: Difference between revisions

added php
(added ruby)
(added php)
Line 160:
#functions go here...
1;</perl>
 
=={{header|PHP}}==
<ruby>class Animal {
#// functions go here...
}
 
class Dog <extends Animal {
// functions go here...
}
 
class Cat extends Animal {
// functions go here...
}
 
class Lab extends Dog {
// functions go here...
}
 
class Collie extends Dog {
// functions go here...
}</ruby>
 
=={{header|Python}}==
Line 249 ⟶ 270:
 
class Collie < Dog
#functions go here...
end
 
class Dog < Animal
#functions go here...
end</ruby>
Anonymous user