mirror of
https://github.com/php/php-src.git
synced 2024-12-19 23:11:42 +08:00
Merge branch 'PHP-7.4'
* PHP-7.4: Fix bug #78697: inaccurate error message
This commit is contained in:
commit
174ab25fd4
4
NEWS
4
NEWS
@ -58,6 +58,10 @@ PHP NEWS
|
||||
(krakjoe)
|
||||
. Fixed bug #77805 (phpdbg build fails when readline is shared). (krakjoe)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #78697 (ReflectionClass::implementsInterface - inaccurate error
|
||||
message with traits). (villfa)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #78624 (session_gc return value for user defined session
|
||||
handlers). (bshaffer)
|
||||
|
@ -4990,7 +4990,7 @@ ZEND_METHOD(reflection_class, implementsInterface)
|
||||
|
||||
if (!(interface_ce->ce_flags & ZEND_ACC_INTERFACE)) {
|
||||
zend_throw_exception_ex(reflection_exception_ptr, 0,
|
||||
"Interface %s is a Class", ZSTR_VAL(interface_ce->name));
|
||||
"%s is not an interface", ZSTR_VAL(interface_ce->name));
|
||||
return;
|
||||
}
|
||||
RETURN_BOOL(instanceof_function(ce, interface_ce));
|
||||
|
@ -67,14 +67,14 @@ try {
|
||||
?>
|
||||
--EXPECTF--
|
||||
Does A implement A?
|
||||
- Using object argument: Interface A is a Class
|
||||
- Using string argument: Interface A is a Class
|
||||
- Using object argument: A is not an interface
|
||||
- Using string argument: A is not an interface
|
||||
Does A implement B?
|
||||
- Using object argument: Interface B is a Class
|
||||
- Using string argument: Interface B is a Class
|
||||
- Using object argument: B is not an interface
|
||||
- Using string argument: B is not an interface
|
||||
Does A implement C?
|
||||
- Using object argument: Interface C is a Class
|
||||
- Using string argument: Interface C is a Class
|
||||
- Using object argument: C is not an interface
|
||||
- Using string argument: C is not an interface
|
||||
Does A implement I1?
|
||||
- Using object argument: bool(true)
|
||||
- Using string argument: bool(true)
|
||||
@ -82,14 +82,14 @@ Does A implement I2?
|
||||
- Using object argument: bool(false)
|
||||
- Using string argument: bool(false)
|
||||
Does B implement A?
|
||||
- Using object argument: Interface A is a Class
|
||||
- Using string argument: Interface A is a Class
|
||||
- Using object argument: A is not an interface
|
||||
- Using string argument: A is not an interface
|
||||
Does B implement B?
|
||||
- Using object argument: Interface B is a Class
|
||||
- Using string argument: Interface B is a Class
|
||||
- Using object argument: B is not an interface
|
||||
- Using string argument: B is not an interface
|
||||
Does B implement C?
|
||||
- Using object argument: Interface C is a Class
|
||||
- Using string argument: Interface C is a Class
|
||||
- Using object argument: C is not an interface
|
||||
- Using string argument: C is not an interface
|
||||
Does B implement I1?
|
||||
- Using object argument: bool(true)
|
||||
- Using string argument: bool(true)
|
||||
@ -97,14 +97,14 @@ Does B implement I2?
|
||||
- Using object argument: bool(false)
|
||||
- Using string argument: bool(false)
|
||||
Does C implement A?
|
||||
- Using object argument: Interface A is a Class
|
||||
- Using string argument: Interface A is a Class
|
||||
- Using object argument: A is not an interface
|
||||
- Using string argument: A is not an interface
|
||||
Does C implement B?
|
||||
- Using object argument: Interface B is a Class
|
||||
- Using string argument: Interface B is a Class
|
||||
- Using object argument: B is not an interface
|
||||
- Using string argument: B is not an interface
|
||||
Does C implement C?
|
||||
- Using object argument: Interface C is a Class
|
||||
- Using string argument: Interface C is a Class
|
||||
- Using object argument: C is not an interface
|
||||
- Using string argument: C is not an interface
|
||||
Does C implement I1?
|
||||
- Using object argument: bool(true)
|
||||
- Using string argument: bool(true)
|
||||
@ -112,14 +112,14 @@ Does C implement I2?
|
||||
- Using object argument: bool(true)
|
||||
- Using string argument: bool(true)
|
||||
Does I1 implement A?
|
||||
- Using object argument: Interface A is a Class
|
||||
- Using string argument: Interface A is a Class
|
||||
- Using object argument: A is not an interface
|
||||
- Using string argument: A is not an interface
|
||||
Does I1 implement B?
|
||||
- Using object argument: Interface B is a Class
|
||||
- Using string argument: Interface B is a Class
|
||||
- Using object argument: B is not an interface
|
||||
- Using string argument: B is not an interface
|
||||
Does I1 implement C?
|
||||
- Using object argument: Interface C is a Class
|
||||
- Using string argument: Interface C is a Class
|
||||
- Using object argument: C is not an interface
|
||||
- Using string argument: C is not an interface
|
||||
Does I1 implement I1?
|
||||
- Using object argument: bool(true)
|
||||
- Using string argument: bool(true)
|
||||
@ -127,14 +127,14 @@ Does I1 implement I2?
|
||||
- Using object argument: bool(false)
|
||||
- Using string argument: bool(false)
|
||||
Does I2 implement A?
|
||||
- Using object argument: Interface A is a Class
|
||||
- Using string argument: Interface A is a Class
|
||||
- Using object argument: A is not an interface
|
||||
- Using string argument: A is not an interface
|
||||
Does I2 implement B?
|
||||
- Using object argument: Interface B is a Class
|
||||
- Using string argument: Interface B is a Class
|
||||
- Using object argument: B is not an interface
|
||||
- Using string argument: B is not an interface
|
||||
Does I2 implement C?
|
||||
- Using object argument: Interface C is a Class
|
||||
- Using string argument: Interface C is a Class
|
||||
- Using object argument: C is not an interface
|
||||
- Using string argument: C is not an interface
|
||||
Does I2 implement I1?
|
||||
- Using object argument: bool(true)
|
||||
- Using string argument: bool(true)
|
||||
|
14
ext/reflection/tests/bug78697.phpt
Normal file
14
ext/reflection/tests/bug78697.phpt
Normal file
@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #78697: ReflectionClass::implementsInterface - inaccurate error message with traits
|
||||
--FILE--
|
||||
<?php
|
||||
trait T {}
|
||||
|
||||
try {
|
||||
(new ReflectionClass(new stdClass))->implementsInterface(T::class);
|
||||
} catch (ReflectionException $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
T is not an interface
|
Loading…
Reference in New Issue
Block a user