#42258 [Opn->Asn]: MethodParameter::getDefaultValue() return null
| From: | jani@php.net | Date: | Fri, 17 Aug 2007 13:47:01 +0000 |
| Subject: | #42258 [Opn->Asn]: MethodParameter::getDefaultValue() return null | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-116241@lists.php.net to get a copy of this message | ||
ID: 42258
Updated by: jani@php.net
Reported By: vincent dot hoen at gmail dot com
-Status: Open
+Status: Assigned
Bug Type: Class/Object related
Operating System: windows xp
PHP Version: 5.2.4RC1
-Assigned To:
+Assigned To: johannes
New Comment:
Assigned to the maintainer of reflection extension.
Previous Comments:
------------------------------------------------------------------------
[2007-08-09 15:30:58] vincent dot hoen at gmail dot com
Description:
------------
ReflectionProperty::getDefaultValue() returns null only if the property
is not static.
Reproduce code:
---------------
class test{
public $test = 'aze';
static $stat = 'ic';
}
$class = new ReflectionClass('test');
foreach($class->getProperties() as $k => $v){
var_dump($v->getValue($class));
}
Expected result:
----------------
string 'aze' (length=3)
string 'ic' (length=2)
Actual result:
--------------
null
string 'ic' (length=2)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42258&edit=1