php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #41884 ReflectionClass::getDefaultProperties() does not handle static attributes
Submitted: 2007-07-03 08:35 UTC Modified: 2007-07-11 22:07 UTC
From: sebastian@php.net Assigned: tony2001
Status: Closed Package: Feature/Change Request
PHP Version: 5CVS-2007-07-03 (CVS) OS: Irrelevant
Private report: No CVE-ID:
 [2007-07-03 08:35 UTC] sebastian@php.net
Description:
------------
Static properties with default values do not appear in the result of ReflectionClass::getDefaultProperties().

Reproduce code:
---------------
<?php
class Foo
{
    protected static $fooStatic = 'foo';
    protected $foo = 'foo';
}

$class = new ReflectionClass('Foo');

print_r($class->getDefaultProperties());

Expected result:
----------------
Array
(
    [fooStatic] => foo
    [foo] => foo
)

Actual result:
--------------
Array
(
    [foo] => foo
)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-07-03 09:10 UTC] tony2001@php.net
Here is a patch for it: http://dev.daylessday.org/diff/bug41884.diff
but I'd like to hear Marcus opinion before committing it.

 [2007-07-11 22:07 UTC] tony2001@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.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 00:01:21 2014 UTC