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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: sebastian@php.net
New email:
PHP Version: OS:

 

 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 23:01:26 2024 UTC