#42258 [NEW]: MethodParameter::getDefaultValue() return null

From: Date: Thu, 09 Aug 2007 15:30:58 +0000
Subject: #42258 [NEW]: MethodParameter::getDefaultValue() return null
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-115932@lists.php.net to get a copy of this message
From:             vincent dot hoen at gmail dot com
Operating system: windows xp
PHP version:      5.2.4RC1
PHP Bug Type:     Unknown/Other Function
Bug description:  MethodParameter::getDefaultValue() return null

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 bug report at http://bugs.php.net/?id=42258&edit=1
-- 
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42258&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42258&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42258&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=42258&r=fixedcvs
Fixed in release:             http://bugs.php.net/fix.php?id=42258&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=42258&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=42258&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=42258&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=42258&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=42258&r=notwrong
Not enough info:              http://bugs.php.net/fix.php?id=42258&r=notenoughinfo
Submitted twice:              http://bugs.php.net/fix.php?id=42258&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=42258&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42258&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=42258&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=42258&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=42258&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42258&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=42258&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=42258&r=mysqlcfg


Thread (3 messages)

« previous php.bugs (#115932) next »