<?php
class MyClass {
    // definitions:
    function method() { echo 1;}
    static function staticMethod() {echo 2;}
    function otherMethod() {
        // static internal invocation
        self::staticMethod();
        // dynamic internal invocation
        $this->method();
    }
}

interface MyInterface {
    function interfaceMethod();
}
class MyClass2 extends MyClass implements MyInterface {
    function method() {
        // method override
        parent::method();
    }
    // interface implementation
    function interfaceMethod() {
        echo 5;
    }
}
?>