Start PHP Code RESULT
hello you
hello you
hello you
End PHP Code RESULT
The PHP Code START
class sayHello {
    
    function print_hello( $filter_object ) {
        if ( get_class( $filter_object) != "outputfilter" && !is_sublassof($filter_object,"outputfilter"))
            return false;
        print $filter_object->filter("hello you<br />");
    }
}
    
class OutputFilter {
        function filter( $txt ) {
            return "<strong>$txt</strong>";
        }
}
    
class ItalicFilter extends OutputFilter {
        function filter( $txt ) {
            return "<i>$txt</i>";
        }
}
    
class UnderlineFilter extends OutputFilter {
        function filter( $txt ) {
            return "<u>$txt</u>";
        }
}

class BlinkFilter extends OutputFilter {
        function filter( $txt ) {
            return "<blink>$txt</blink>";
        }
}

$hello = new sayHello();
$hello->print_hello( new OutputFilter() );
$hello->print_hello( new ItalicFilter() );
$hello->print_hello( new UnderlineFilter() );
$hello->print_hello( new BlinkFilter() );
The PHP Code END