php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45571 ReflectionClass::export() shows superclasses' private static methods.
Submitted: 2008-07-20 15:59 UTC Modified: 2008-07-20 16:52 UTC
From: robin_fernandes at uk dot ibm dot com Assigned:
Status: Closed Package: Reflection related
PHP Version: 5.3CVS-2008-07-20 (snap) OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: robin_fernandes at uk dot ibm dot com
New email:
PHP Version: OS:

 

 [2008-07-20 15:59 UTC] robin_fernandes at uk dot ibm dot com
Description:
------------
A change was made in 5.3 so that ReflectionClass::export() does not list private methods from superclasses (see http://bugs.php.net/37964). However, the change was not applied for static methods.

Proposed patch to restore consistency: http://pastebin.ca/1077574 .


Reproduce code:
---------------
<?php
Class A { 
	private function f() {}
	private static function sf() {}
}

Class C extends A { }

ReflectionClass::export("C");
?>

Expected result:
----------------
Class [ <user> class C extends A ] {
  @@ %s 7-7

  - Constants [0] {
  }

  - Static properties [0] {
  }

  - Static methods [0] {
  }

  - Properties [0] {
  }

  - Methods [0] {
  }
}

Actual result:
--------------
Class [ <user> class C extends A ] {
  @@ %s 7-7

  - Constants [0] {
  }

  - Static properties [0] {
  }

  - Static methods [1] {
    Method [ <user, inherits A> static private method sf ] {
      @@ %s 4 - 4
    }
  }

  - Properties [0] {
  }

  - Methods [0] {
  }
}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-20 16:52 UTC] felipe@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.

Hi Robin, thanks for the patch. ;)
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Aug 19 01:01:26 2019 UTC