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

Author:

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>
";
?>

Leave a Reply

Your email address will not be published. Required fields are marked *