#30209 [Ver->Csd]: ReflectionClass::getMethod() lowercases attribute
| From: | sebastian@php.net | Date: | Thu, 23 Sep 2004 19:04:52 +0000 |
| Subject: | #30209 [Ver->Csd]: ReflectionClass::getMethod() lowercases attribute | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-66612@lists.php.net to get a copy of this message | ||
ID: 30209
Updated by: sebastian@php.net
Reported By: sb at sebastian-bergmann dot de
-Status: Verified
+Status: Closed
Bug Type: Zend Engine 2 problem
Operating System: *
PHP Version: 5.0.1
Assigned To: helly
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2004-09-23 16:26:55] sb at sebastian-bergmann dot de
Description:
------------
Calling getMethod() on a ReflectionClass object for the current object
lowercases the contents of the variable that is passed to it.
Hardcoding the getMethod() parameter prevents the lowercasing while
copying the value from $this->name to $name and passing that to
getMethod() does not.
Reproduce code:
---------------
<?php
class Foo {
private $name = 'testBar';
public function testBar() {
try {
$class = new ReflectionClass($this);
var_dump($this);
$method = $class->getMethod($this->name);
var_dump($this);
}
catch (Exception $e) {}
}
}
$foo = new Foo;
$foo->testBar();
?>
Expected result:
----------------
object(Foo)#1 (1) {
["name:private"]=>
string(7) "testBar"
}
object(Foo)#1 (1) {
["name:private"]=>
string(7) "testBar"
}
Actual result:
--------------
object(Foo)#1 (1) {
["name:private"]=>
string(7) "testBar"
}
object(Foo)#1 (1) {
["name:private"]=>
string(7) "testbar"
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30209&edit=1