(PHP 5, PHP 7)
ReflectionClass::export — 導出一個(gè)類(lèi)
導出一個(gè)反射后的類(lèi)。
argument導出的反射。
return
設為 true 時(shí)返回導出結果,設為 false(默認值)則忽略返回。
如果參數 return
設為 true,導出結果將作為 string
返回,否則返回 null。
示例 #1 ReflectionClass::export() 的基本用法
<?php
class Apple {
public $var1;
public $var2 = 'Orange';
public function type() {
return 'Apple';
}
}
ReflectionClass::export('Apple');
?>
以上例程的輸出類(lèi)似于:
Class [ <user> class Apple ] {
@@ php shell code 1-8
- Constants [0] {
}
- Static properties [0] {
}
- Static methods [0] {
}
- Properties [2] {
Property [ <default> public $var1 ]
Property [ <default> public $var2 ]
}
- Methods [1] {
Method [ <user> public method type ] {
@@ php shell code 5 - 7
}
}
}