Reflection API does not recognize mixed-case class hints
| Bug #26695 | Reflection API does not recognize mixed-case class hints | ||||
|---|---|---|---|---|---|
| Submitted: | 2003-12-22 13:52 UTC | Modified: | 2003-12-22 14:59 UTC | ||
| From: | hans at velum dot net | Assigned: | helly (profile) | ||
| Status: | Closed | Package: | Class/Object related | ||
| PHP Version: | 5.0.0b3 | OS: | * | ||
| Private report: | No | CVE-ID: | None | ||
[2003-12-22 13:52 UTC] hans at velum dot net
Description:
------------
This is a problem in PHP 5.0.0b3 (distro), which wasn't an option in the bug report select list.
Basically, upon upgrading to PHP5.0.0b3 our application generated runtime Reflection_Exceptions claiming to be unable to find the class specified by a class hint.
E.g. when calling
$params = $method->getParameters();
$hint = $params[0]->getClass();
Changing the class hint to lowercase fixes this problem.
Reproduce code:
---------------
class Foo {
}
class Bar {
function demo(Foo $f) {
// nothing
}
}
$class = new Reflection_Class('Bar');
$methods = $class->getMethods();
$params = $methods[0]->getParameters();
$hint = $params[0]->getClass();
// reflection_exception was thrown
print "Class expected is: ". $hint . "\n";
Expected result:
----------------
Class expected is: Foo
Actual result:
--------------
<b>Fatal error</b>: Uncaught exception 'reflection_exception' with message 'Class Foo does not exist' in ...
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2003-12-22 14:59 UTC] helly@php.net