#47019 [Opn]: \ReflectionParameter->getClass()->getName() is broken.

From: Date: Tue, 06 Jan 2009 16:30:25 +0000
Subject: #47019 [Opn]: \ReflectionParameter->getClass()->getName() is broken.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-132595@lists.php.net to get a copy of this message
ID: 47019 User updated by: daniel dot gorski at develnet dot org Reported By: daniel dot gorski at develnet dot org Status: Open -Bug Type: Class/Object related +Bug Type: Reflection related Operating System: Linux PHP Version: 5.3CVS-2009-01-06 (CVS) New Comment: Changed category to "Reflection related". g. Previous Comments: ------------------------------------------------------------------------ [2009-01-06 11:49:57] daniel dot gorski at develnet dot org Description: ------------ The \ReflectionParameter->getClass()->getName() method returns a wrong value. It omits the leading namespace slash. Reproduce code: --------------- namespace A\B\C; class Bar {} namespace D; class Foo { function foo(\A\B\C\Bar $x) {} } $rm = new \ReflectionMethod('\D\Foo', 'foo'); $rp = $rm->getParameters(); echo $rp[0]->getClass()->getName(); Expected result: ---------------- \A\B\C\Bar Actual result: -------------- A\B\C\Bar ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=47019&edit=1

« previous php.bugs (#132595) next »