I am looking for a way to get a list of all the php functions but needed them group by the class they exist in. Not sure if there is a way to get this from PHP docs or if its built into PHP. I am really only looking for built in / popular classes, so a custom mysqli class I dont care about but the mysql library that can be installed with PHP I do need.
Thank you very much
Try this:
foreach(get_declared_classes() as $classname) {
echo $classname . PHP_EOL;
$class = new ReflectionClass($classname);
foreach($class->getMethods() as $m) {
echo ' ' . $m->name . PHP_EOL;
}
}
I'm using get_declared_classes()
to get a list of all declared classes. Then I create a ReflectionClass
object from them and iterate throught their methods.