This site is mobile accessible. Press the "Tap Here" button to use a different font-size.


Smartphone icons created by Freepik - Flaticon

PHP Interfaces

Using Interfaces

Meow

<?php
// define interface Animal
interface Animal {
  public function makeSound();
}

// class Cat implements Animal
class Cat implements Animal {
  public function makeSound() {
    echo "Meow";
  }
}

// implement $animal makeSound
$animal = new Cat();
$animal->makeSound();
?>