PHPackages                             fsi/reflection - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. fsi/reflection

AbandonedLibrary[Utility &amp; Helpers](/categories/utility)

fsi/reflection
==============

FSi Reflection Component is an extension of built-in reflection classes in PHP 5.3 that saves a lot memory, thanks to factory design pattern.

0.9.2(13y ago)865.1k↓23.1%3[1 issues](https://github.com/fsi-open/reflection/issues)2PHPPHP &gt;=5.3.0

Since Jul 10Pushed 11y ago7 watchersCompare

[ Source](https://github.com/fsi-open/reflection)[ Packagist](https://packagist.org/packages/fsi/reflection)[ RSS](/packages/fsi-reflection/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (2)

Reflection - Optimized reflection package for PHP 5.3
=====================================================

[](#reflection---optimized-reflection-package-for-php-53)

FSi Reflection component is an extension of built-in reflection classes in PHP 5.3. Some of their methods are rewritten in such way that reflection objects are cached and never created twice for the same class/method/property/function or extension. This is achieved by usage of factory pattern. Some of the methods that cannot be rewriten to use such a cache throw an exception. All ReflectionProperty and ReflectionMethod objects returned from this library are previously set as accessible so they can be used even if they're private or protected.

Setup and autoloading
---------------------

[](#setup-and-autoloading)

We highly recommend to use autoloader generated by composer.phar

**Adding reflection into composer.json**

```
{
    ...
    "require": {
        ...
        "fsi/reflection": "0.9.*"
        ...
    },
    ...
}

```

Usage example
-------------

[](#usage-example)

The key idea of using this reflection library is not to contruct reflection classes by their constructors but through the factory() methods added to each reflection class. Let's assume we have a class named ClassA:

```
