|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77326 ReflectionClass::getReflectionConstant() returns false instead of exception
Submitted: 2018-12-20 13:52 UTC Modified: 2018-12-20 23:37 UTC
Avg. Score:2.0 ± 1.0
Reproduced:0 of 1 (0.0%)
From: me at vasekpurchart dot cz Assigned:
Status: Open Package: Reflection related
PHP Version: 7.2 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: me at vasekpurchart dot cz
New email:
PHP Version: OS:


 [2018-12-20 13:52 UTC] me at vasekpurchart dot cz
ReflectionClass::getReflectionConstant() returns false when constant is not found. This is unexpected because all other methods like getMethod() or getProperty() which have equivalent signatures and fuction throw a ReflectionException.

The return value is also not documented.

Test script:

class Foo {}

$barClassReflection = new ReflectionClass(Foo::class);

Expected result:
Throw exception like the other methods on ReflectionClass to behave consistently and document this behavior.


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-12-20 23:37 UTC]
-PHP Version: 7.3.0 +PHP Version: 7.2
 [2018-12-27 03:24 UTC]
The following pull request has been associated:

Patch Name: Fixed bug #77326 (ReflectionClass::getReflectionConstant() returns false instead of exception)
On GitHub:
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Apr 20 11:01:23 2021 UTC