PHP – getting a list of currently loaded classes

In some cases you may need to investigate which classes are loaded in the current scope. You can do it pretty fine with the get_declared_classes() function. This function will return an array of currently available classes.

<?php
    include_once("class.myClass.php");
    print_r(get_declared_classes());
?>

Tags:

Leave a Reply