Helpful Utility Functions : class_exists « Reflection « PHP






Helpful Utility Functions

 
<?
    if ($foo =  = $bar) {
            $sam = new Employee;
    } else {
            $sam = new Dog;
    }

    print "Sam is a " . get_class($sam) . "\n";
    print "Class animal exists: " . class_exists("animal") . "\n\n\n\n";
    print "All declared classes are: " . get_declared_classes( ) . "\n";
?>
  
  








Related examples in the same category

1.Checking for the Existence of Classes and Interfaces Using class_exists() and interface_exists()