Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/thiagodp/rtti

A Run-Time Type Information extractor, useful for getting/setting private attributes from/to PHP objects.
https://github.com/thiagodp/rtti

attribute class php phputil run-time type

Last synced: 8 days ago
JSON representation

A Run-Time Type Information extractor, useful for getting/setting private attributes from/to PHP objects.

Awesome Lists containing this project

README

        

# RTTI

A Run-Time Type Information extractor, useful for getting or setting private and protected attributes from/to PHP objects.

We use [semantic versioning](http://semver.org/). See [our releases](https://github.com/thiagodp/rtti/releases).

Classes:

* [phputil\RTTI](https://github.com/thiagodp/rtti/blob/master/lib/RTTI.php)

### Installation

```command
composer require phputil/rtti
```

### Example

Extracting all attributes from a class (even `private` or `protected`).

```php
name = $n; }
function getName() { return $this->name; }
}

// array( 'user' => 'Bob' )
var_dump( RTTI::getAttributes( new User( 'Bob' ), RTTI::allFlags() ) );
?>
```

## License

[MIT](https://choosealicense.com/licenses/mit/) (c) [Thiago Delgado Pinto](https://github.com/thiagodp)