Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Lister les méthodes et interfaces avec ‘get_class_methods()’

classes
{filelink=15054}

<?php
interface Personnes
{
  function getPoints();
  function setPoints($x, $y);
}
class Forme_GEO {
  function __construct($nom) {
  }

}

$rectangle = new Forme_GEO ( 'r' );
$carree = new Forme_GEO ( 'c' );
$polygon = new Forme_GEO ( 'p' );

$classes = array ('Forme_GEO',  'ParentIterator', 'Rectangle' );
$interfaces = array ('citoyen', 'Produit', 'Clients', 'Personnes' );

print "<p>";
foreach ( $classes as $class )
  printf ( "La classe '%s'  %s défin.<br />
", $class, class_exists ( $class, false ) ? 'est' : "n'est pas " );
print "</p>
<p>";

foreach ( $interfaces as $interface )
  printf ( "L'interface '%s' %s défini.<br />
", $interface, interface_exists ( $interface, false ) ? 'est ' : "n'est pas ");
print "</p>
";
?>

No comments yet.

Leave a Comment