|
ReflectionFunctionAbstract::getClosureCalledClassReturns the class corresponding to static:: inside a closure 説明
public ReflectionClassnull ReflectionFunctionAbstract::getClosureCalledClass()
Returns the class as a ReflectionClass that
corresponds to resolving the class name corresponding to パラメータこの関数にはパラメータはありません。 戻り値
Returns a ReflectionClass corresponding to the class
represented by 例例1 Example showcasing difference between ReflectionFunctionAbstract::getClosureCalledClass, ReflectionFunctionAbstract::getClosureScopeClass, and ReflectionFunctionAbstract::getClosureThis with a closure in the object context
上の例の出力は以下となります。 string(1) "A" string(1) "B" object(B)#1 (0) { } object(ReflectionClass)#4 (1) { ["name"]=> string(1) "A" } object(ReflectionClass)#4 (1) { ["name"]=> string(1) "B" } 例2 Example showcasing difference between ReflectionFunctionAbstract::getClosureCalledClass, ReflectionFunctionAbstract::getClosureScopeClass, and ReflectionFunctionAbstract::getClosureThis with a static closure without an object context
上の例の出力は以下となります。 string(1) "A" string(1) "B" NULL object(ReflectionClass)#4 (1) { ["name"]=> string(1) "A" } object(ReflectionClass)#4 (1) { ["name"]=> string(1) "B" } 参考
|