Created
June 27, 2016 20:49
-
-
Save nWidart/e311f71fc65d53c91a945b05912593aa to your computer and use it in GitHub Desktop.
Return array of all classes implementing the Iterator Interface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Source: http://stackoverflow.com/questions/3993759/php-how-to-get-a-list-of-classes-that-implement-certain-interface | |
print_r( | |
array_filter( | |
get_declared_classes(), | |
function ($className) { | |
return in_array('Iterator', class_implements($className)); | |
} | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment