# Suggestions for Reflection API

- Thread: https://externals.io/message/8113
- Original archive: https://news-web.php.net/php.internals/8113
- Started by Sebastian Bergmann on 2004-02-25T07:55:54+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

---

## #8113 — Sebastian Bergmann — 2004-02-25T07:55:54+00:00

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

Hi,

  I just looked for the first time in months at the Reflection API and
  have two suggestions:

    1.) There are a couple of methods that throw an Exception.

        I think it would be better to introduce a Reflection_Exception
        class that is thrown instead of the standard Exception.

        If possible, it might be a good idea to only allow throwing
        Reflection_Exception instances to the internal Reflection_*
        classes.

    2.) getVersion() is currently only declared for Reflection_Extension.

        I think it would be nice if we had versioning for classes and
        methods available through the Reflection API, too.

        This could be achieved, for instance, by either introducing yet
        another __-prepended property (const $__version = '1.0.0', for
        example) or by using metadata in doc-comments (@version 1.0.0).

        This would solve the versioning problem that is currently
        discussed on the pear-dev list, IMHO.

  Greetings,
Sebastian

-- 
Sebastian Bergmann
http://sebastian-bergmann.de/                   http://phpOpenTracker.de/

Das Buch zu PHP 5: http://professionelle-softwareentwicklung-mit-php5.de/
