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 (profile)
Status: Closed Package: Feature/Change Request
PHP Version: 5CVS-2007-07-03 (CVS) OS: Irrelevant
Private report: No CVE-ID: None
 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 17:01:58 2024 UTC