# [PATCH] Allow get_declared_classes() and get_declared_interfaces() return user/internal class/interface separately

- Thread: https://externals.io/message/28634
- Original archive: https://news-web.php.net/php.internals/28634
- Started by Jani Taskinen on 2007-03-28T22:43:45+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #28634 — Jani Taskinen — 2007-03-28T22:43:45+00:00

URL: https://externals.io/message/28634#28634

This patch allows get_declared_classes and `get_declared_interfaces()`
functions to return the information in associative array with "internal"
and "user" keys when passed the optional parameter. And makes them a bit
more consistent with similar functions like `get_defined_functions()`..

Example:

[jani@localhost php_5_2tst]$ sapi/cli/php -r 'class foobar {}
print_r(get_declared_classes(true));'|less
Array
(
     [internal] => Array
         (
             [0] => stdClass
             [1] => Exception
             [2] => ErrorException
             [3] => __PHP_Incomplete_Class
             [4] => php_user_filter
             [5] => Directory
             [6] => DateTime
             [7] => DateTimeZone
         )

     [user] => Array
         (
             [0] => foobar
         )

)

--Jani
