Example #1 ReflectionClass 的基本用法
Reflection::export(newReflectionClass('Exception'));?>
以上例程的输出类似于:
Class [ class Exception ] {
- Constants [0] {
}
- Static properties [0] {
}
- Static methods [0] {
}
- Properties [7] {
Property [ protected $message ]
Property [ private $string ]
Property [ protected $code ]
Property [ protected $file ]
Property [ protected $line ]
Property [ private $trace ]
Property [ private $previous ]
}
- Methods [10] {
Method [ final private method __clone ] {
}
Method [ public method __construct ] {
- Parameters [3] {
Parameter #0 [ $message ]
Parameter #1 [ $code ]
Parameter #2 [ $previous ]
}
}
Method [ final public method getMessage ] {
}
Method [ final public method getCode ] {
}
Method [ final public method getFile ] {
}
Method [ final public method getLine ] {
}
Method [ final public method getTrace ] {
}
Method [ final public method getPrevious ] {
}
Method [ final public method getTraceAsString ] {
}
Method [ public method __toString ] {
}
}
}