php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #42360 add paramets for get_declared_classes() - filter by parent class/interface
Submitted: 2007-08-21 13:13 UTC Modified: 2016-12-31 00:14 UTC
Votes:2
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: max at redline-software dot com Assigned:
Status: Open Package: Class/Object related
PHP Version: 5.2.3 OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-08-21 13:13 UTC] max at redline-software dot com
Description:
------------
The goal is to return all declared subclasses of given class_name/interface


Reproduce code:
---------------
interface A {}
class A1 implements A {}
class A2 implements A {}
class B extends A1 {}
class C {}

print_r(get_declared_classes('A'));
print_r(get_declared_classes('A1'));

Expected result:
----------------
// print_r(get_declared_classes('A'));
Array
(
    [0] => A1
    [1] => A2
    [2] => B
)

// print_r(get_declared_classes('A1'));
Array
(
    [2] => B
)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-31 00:14 UTC] cmb@php.net
-Package: Feature/Change Request +Package: Class/Object related
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 18:01:26 2019 UTC