<?php
namespace Proto
{
interface A
{
public function aaa();
}
class Foo implements A
{
public function aaa()
{
return 'aaa';
}
}
}
$i = 10000;
$className = Proto\Foo::class;
while ($i--) {
$interfaces = class_implements($className);
if (false === $interfaces || !isset($interfaces[Proto\A::class])) {
throw new \Exception(sprintf('Class "%s" should implement "%s"', $className, Proto\A::class));
}
}
echo 'ok', PHP_EOL;