Merge branch 'PHP-8.1'

* PHP-8.1:
  Remove unnecessary assertion
This commit is contained in:
Nikita Popov 2021-11-04 17:01:04 +01:00
commit ce62a98534
2 changed files with 18 additions and 1 deletions

View file

@ -0,0 +1,18 @@
--TEST--
Interface with __toString() method
--FILE--
<?php
interface MyStringable {
public function __toString(): string;
}
$rc = new ReflectionClass(MyStringable::class);
var_dump($rc->getInterfaceNames());
?>
--EXPECT--
array(1) {
[0]=>
string(10) "Stringable"
}

View file

@ -2347,7 +2347,6 @@ ZEND_API zend_result ZEND_FASTCALL is_smaller_or_equal_function(zval *result, zv
ZEND_API bool ZEND_FASTCALL zend_class_implements_interface(const zend_class_entry *class_ce, const zend_class_entry *interface_ce) /* {{{ */
{
uint32_t i;
ZEND_ASSERT(!(class_ce->ce_flags & ZEND_ACC_INTERFACE));
ZEND_ASSERT(interface_ce->ce_flags & ZEND_ACC_INTERFACE);
if (class_ce->num_interfaces) {