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:3
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
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: max at redline-software dot com
New email:
PHP Version: OS:

 

 [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-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 08:01:29 2024 UTC