- printf: documentation ( source)
<?php
$c = Collator::class;
$rc = new ReflectionClass($c);
foreach ($rc->getMethods(ReflectionMethod::IS_PUBLIC) as $rm) {
printf("- %s::%s:\n%d\n%d\n", $c, $rm->getName(), $rm->getNumberOfParameters(), $rm->getNumberOfRequiredParameters());
foreach ($rm->getParameters() as $param) {
printf("Parameter #%d (%s) %s OPTIONAL\n", $param->getPosition(), $param->getName(), $param->isOptional() ? "IS" : "IS NOT");
}
echo PHP_EOL;
}