php.net |  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: villfa@php.net Assigned: villfa (profile)
Status: Closed Package: Reflection related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2019-10-19 19:35 UTC] villfa@php.net
Description:
------------
When ReflectionClass::implementsInterface receives a trait as a parameter the message of the thrown exception says that the trait is a class.

Test script:
---------------
<?php
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

Patches

Pull Requests

Pull requests:

History

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

Patch Name: Fix bug #78697: inaccurate error message
On GitHub:  https://github.com/php/php-src/pull/4834
Patch:      https://github.com/php/php-src/pull/4834.patch
 [2019-10-20 19:50 UTC] villfa@php.net
-Assigned To: +Assigned To: villfa
 [2019-10-21 07:25 UTC] krakjoe@php.net
Automatic comment on behalf of fabien.villepinte@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=bea2ff88c9536ffd157c5fa304bd29a9cee85524
Log: Fix bug #78697: inaccurate error message
 [2019-10-21 07:25 UTC] krakjoe@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 16:01:33 2024 UTC