Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

10 Commits

Repository files navigation

RTTI

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

We use semantic versioning. See our releases.

Classes:

Installation

composer require phputil/rtti

Example

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

<?phprequire_once'vendor/autoload.php'; // or 'RTTI.php' when not using composerusephputil\RTTI;
class User {
private$name;
function__construct( $n ) { $this->name = $n; }
functiongetName() { return$this->name; }
}
// array( 'user' => 'Bob' )var_dump( RTTI::getAttributes( newUser( 'Bob' ), RTTI::allFlags() ) );
?>

License

MIT (c) Thiago Delgado Pinto

About

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

Topics

Resources

Stars

2 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages