purpose of interface in classes
<p>what is the purpose of interface when writing a class?</p>

<p>heres an example i've seen online.</p>

<pre><code>&lt;?php
interface Chargeable {
    public function getPrice();
}

class Employee implements Chargeable {
    protected $price;

    public function getPrice() {
        return $this-&gt;price;
    }
}

$product = new Employee();

?&gt;
</code></pre>
