- strpos: documentation ( source)
- get_declared_classes: documentation ( source)
<?php
$foo = new ArrayIterator(get_declared_classes());
$function = function($value, $key, $iterator) {
return strpos($value, 'Exception');
};
$bar = new CallbackFilterIterator($foo, $function);
echo 'Exceptions:' . PHP_EOL;
foreach ($bar as $class) {
echo $class . PHP_EOL;
}