PHP code example of hanwenbo / reflect
1. Go to this page and download the library: Download hanwenbo/reflect library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
hanwenbo / reflect example snippets
$test = new \hanwenbo\reflect\Reflect( new Test );
// 设置禁止的方法
$test->setDenyFunctionList(['del','info']);
// 获得类名字
var_dump( $test->getClassReflect()->getName() );
// 获得反射的方法列表
$list = $test->getFunctionListReflect();
foreach( $list as $row ){
var_dump( $row->getName() );
var_dump( $row->getTitle() );
var_dump( $row->getParam('method') );
}