mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: Remove unnecessary assertion
This commit is contained in:
commit
e291dcd836
2 changed files with 18 additions and 1 deletions
18
Zend/tests/interface_with_tostring.phpt
Normal file
18
Zend/tests/interface_with_tostring.phpt
Normal 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"
|
||||||
|
}
|
|
@ -2302,7 +2302,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) /* {{{ */
|
ZEND_API bool ZEND_FASTCALL zend_class_implements_interface(const zend_class_entry *class_ce, const zend_class_entry *interface_ce) /* {{{ */
|
||||||
{
|
{
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
ZEND_ASSERT(!(class_ce->ce_flags & ZEND_ACC_INTERFACE));
|
|
||||||
ZEND_ASSERT(interface_ce->ce_flags & ZEND_ACC_INTERFACE);
|
ZEND_ASSERT(interface_ce->ce_flags & ZEND_ACC_INTERFACE);
|
||||||
|
|
||||||
if (class_ce->num_interfaces) {
|
if (class_ce->num_interfaces) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue