phputil/rtti
最新稳定版本:1.4.1
Composer 安装命令:
composer require phputil/rtti
包简介
A Run-Time Type Information extractor, useful for getting/setting private attributes from/to PHP objects.
README 文档
README
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).
<?php require_once 'vendor/autoload.php'; // or 'RTTI.php' when not using composer use phputil\RTTI; class User { private $name; function __construct( $n ) { $this->name = $n; } function getName() { return $this->name; } } // array( 'user' => 'Bob' ) var_dump( RTTI::getAttributes( new User( 'Bob' ), RTTI::allFlags() ) ); ?>
License
统计信息
- 总下载量: 6.44k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-10-22