Example #1 ReflectionClass::__toString() 例子
$reflectionClass= newReflectionClass(‘Exception’);
echo$reflectionClass->__toString();?>
以上例程会输出:
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 ] {
}
}
}
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/229233.html原文链接:https://javaforall.net
