implements¶
Implements is a keyword, dedicated to classes. It specify which interfaces a class implements.
Implemented interfaces may be tested with types, instanceof, and is_a().
The list of implemented interfaces is accessible with the class_implements() function.
<?php
interface I {
function fooi() ;
}
// empty interface
interface J { }
class X implements I, J {
private $property;
public function fooi() {
return 1;
}
}
?>
See also PHP Interfaces: How to Implement and Use Them.
Related : Class, Class Getter Method, extends, class_implements()
Added in PHP 5.0+