|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78697 ReflectionClass::implementsInterface - inaccurate error message with traits
Submitted: 2019-10-19 19:35 UTC Modified: 2019-10-20 19:50 UTC
From: Assigned: villfa (profile)
Status: Closed Package: Reflection related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2019-10-19 19:35 UTC]
When ReflectionClass::implementsInterface receives a trait as a parameter the message of the thrown exception says that the trait is a class.

Test script:
trait T {}

try {
    (new ReflectionClass(new stdClass))->implementsInterface(T::class);
} catch (ReflectionException $e) {
    echo $e->getMessage();

Expected result:
T is not an interface

Actual result:
Interface T is a Class


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-10-19 19:37 UTC]
The following pull request has been associated:

Patch Name: Fix bug #78697: inaccurate error message
On GitHub:
 [2019-10-20 19:50 UTC]
-Assigned To: +Assigned To: villfa
 [2019-10-21 07:25 UTC]
Automatic comment on behalf of
Log: Fix bug #78697: inaccurate error message
 [2019-10-21 07:25 UTC]
-Status: Assigned +Status: Closed
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Oct 04 23:01:25 2023 UTC