class Shape {
function __construct($name) {
}
}
$polly = new Shape ( 'A' );
$tweety = new Shape ( 'C' );
$square = new Shape ( 'S' );
$classes = array ('Parrot', 'Canary', 'Bird', 'Monkey', 'Pet' );
$interfaces = array ('Pet', 'Product', 'Customer', 'Bird' );
print "";
foreach ( $classes as $class )
printf ( "The class '%s' is %sdefined.
\n", $class, class_exists ( $class, FALSE ) ? '' : 'un' );
print "
\n";
foreach ( $interfaces as $interface )
printf ( "The interface '%s' is %sdefined.
\n", $interface, interface_exists ( $interface, FALSE ) ? '' : 'un' );
print "
\n";
?>