Bug #63370 [NEW]: ReflectionCLass::getDefaultProperties() return is incorrect for static properti
| From: | dimzav at gmail dot com | Date: | Fri, 26 Oct 2012 14:01:46 +0000 |
| Subject: | Bug #63370 [NEW]: ReflectionCLass::getDefaultProperties() return is incorrect for static properti | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-174340@lists.php.net to get a copy of this message | ||
From: dimzav at gmail dot com
Operating system: Win 7 x64
PHP version: 5.3.18
Package: Reflection related
Bug Type: Bug
Bug description:ReflectionCLass::getDefaultProperties() return is incorrect for static properti
Description:
------------
ReflectionCLass::getDefaultProperties() returns current value of static
property, not the default one. I can't add comment to
https://bugs.php.net/bug.php?id=51581 but it is
evidently a bug and must be
fixed.
Test script:
---------------
class A
{
public static $a = 1;
}
A::$a = 2;
$reflectionCLass = new ReflectionClass('A');
$defaultProperties = $reflectionCLass->getDefaultProperties();
var_dump($defaultProperties);
Expected result:
----------------
Default value of $a static property is 1, it should be returned by
ReflectionCLass::getDefaultProperties() instead of current value.
Actual result:
--------------
C:\OpenServer\modules\php\PHP-5.3.18\php.exe temp.php
array(1) {
["a"]=>
int(2)
}
--
Edit bug report at https://bugs.php.net/bug.php?id=63370&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63370&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63370&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63370&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=63370&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=63370&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=63370&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=63370&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=63370&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=63370&r=support
Expected behavior: https://bugs.php.net/fix.php?id=63370&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=63370&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=63370&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=63370&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63370&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=63370&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=63370&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=63370&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63370&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=63370&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=63370&r=mysqlcfg