--- /dev/null
+--TEST--
+Bug #30922 (reflective functions crash PHP when interfaces extend themselves)
+--FILE--
+<?php
+interface RecurisiveFooFar extends RecurisiveFooFar {}
+class A implements RecurisiveFooFar {}
+
+$a = new A();
+var_dump($a instanceOf A);
+echo "ok\n";
+?>
+--EXPECTF--
+Fatal error: Interface RecurisiveFooFar cannot not implement itself in %sbug30922.php on line %d
if (!(ce->ce_flags & ZEND_ACC_INTERFACE) && iface->interface_gets_implemented && iface->interface_gets_implemented(iface, ce TSRMLS_CC) == FAILURE) {
zend_error(E_CORE_ERROR, "Class %s could not implement interface %s", ce->name, iface->name);
}
+ if (ce == iface) {
+ zend_error(E_ERROR, "Interface %s cannot not implement itself", ce->name);
+ }
}