Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > #30209 : ReflectionClass::getMethod() lowercases attribute
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 22nd February 08:20
php-bugs
External User
 
Posts: 1
Default #30209 : ReflectionClass::getMethod() lowercases attribute



From: sb at sebastian-bergmann dot de
Operating system: Irrelevant
PHP version: 5CVS-2004-09-23 (dev)
PHP Bug Type: Zend Engine 2 problem
Bug description: ReflectionClass::getMethod() lowercases attribute

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) {
["namerivate"]=>
string(7) "testBar"
}
object(Foo)#1 (1) {
["namerivate"]=>
string(7) "testBar"
}

Actual result:
--------------
object(Foo)#1 (1) {
["namerivate"]=>
string(7) "testBar"
}
object(Foo)#1 (1) {
["namerivate"]=>
string(7) "testbar"
}

--
Edit bug report at http://bugs.php.net/?id=30209&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30209&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30209&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30209&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30209&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30209&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30209&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30209&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30209&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30209&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30209&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=30209&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=30209&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30209&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30209&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30209&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30209&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30209&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30209&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30209&r=mysqlcfg
  Reply With Quote


  sponsored links


2 22nd February 08:20
External User
 
Posts: 1
Default #30209 : ReflectionClass::getMethod() lowercases attribute



ID: 30209
Updated by: sebastian@php.net
Reported By: sb at sebastian-bergmann dot de
-Status: Open
+Status: Verified
Bug Type: Zend Engine 2 problem
Operating System: Irrelevant
PHP Version: 5CVS-2004-09-23 (dev)


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) {
["namerivate"]=>
string(7) "testBar"
}
object(Foo)#1 (1) {
["namerivate"]=>
string(7) "testBar"
}

Actual result:
--------------
object(Foo)#1 (1) {
["namerivate"]=>
string(7) "testBar"
}
object(Foo)#1 (1) {
["namerivate"]=>
string(7) "testbar"
}


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=30209&edit=1
  Reply With Quote
3 22nd February 11:07
External User
 
Posts: 1
Default #30209 : ReflectionClass::getMethod() lowercases attribute


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) {
["namerivate"]=>
string(7) "testBar"
}
object(Foo)#1 (1) {
["namerivate"]=>
string(7) "testBar"
}

Actual result:
--------------
object(Foo)#1 (1) {
["namerivate"]=>
string(7) "testBar"
}
object(Foo)#1 (1) {
["namerivate"]=>
string(7) "testbar"
}


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=30209&edit=1
  Reply With Quote
4 23rd February 17:54
php-bugs
External User
 
Posts: 1
Default #30209 : ReflectionClass::getMethod() lowercases attribute


ID: 30209
Comment by: sohu119 at sohu dot com
Reported By: sb at sebastian-bergmann dot de
Status: Closed
Bug Type: Zend Engine 2 problem
Operating System: *
PHP Version: 5.0.1
Assigned To: helly
New Comment:

111


Previous Comments:
------------------------------------------------------------------------

[2004-09-23 21:04:51] sebastian@php.net

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.

------------------------------------------------------------------------

[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) {
["namerivate"]=>
string(7) "testBar"
}
object(Foo)#1 (1) {
["namerivate"]=>
string(7) "testBar"
}

Actual result:
--------------
object(Foo)#1 (1) {
["namerivate"]=>
string(7) "testBar"
}
object(Foo)#1 (1) {
["namerivate"]=>
string(7) "testbar"
}


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=30209&edit=1
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666