diff --git a/reference/reflection/reflectionfunctionabstract/getclosurecalledclass.xml b/reference/reflection/reflectionfunctionabstract/getclosurecalledclass.xml index 40931e981b92..0d02155c69d8 100644 --- a/reference/reflection/reflectionfunctionabstract/getclosurecalledclass.xml +++ b/reference/reflection/reflectionfunctionabstract/getclosurecalledclass.xml @@ -13,7 +13,7 @@ Returns the class as a ReflectionClass that - corresponds to static:: inside the + corresponds to resolving the class name corresponding to static:: inside the Closure. @@ -41,31 +41,31 @@ ReflectionFunctionAbstract::getClosureCalledClass, ReflectionFunctionAbstract::getClosureScopeClass, and ReflectionFunctionAbstract::getClosureThis - with an instance method + with a closure in the object context getClosure(); $r = new ReflectionFunction($c); -var_dump($r->getClosureThis()); // $this === $b -var_dump($r->getClosureScopeClass()); // self::class -var_dump($r->getClosureCalledClass()); // static::class + +var_dump($r->getClosureThis()); // $this === $b, since a non-static closure take the object context +var_dump($r->getClosureScopeClass()); // Corresponds to the self::class resolution inside a closure +var_dump($r->getClosureCalledClass()); // Corresponds to the static::class resolution inside a closure ?> ]]> @@ -94,31 +94,31 @@ object(ReflectionClass)#4 (1) { ReflectionFunctionAbstract::getClosureCalledClass, ReflectionFunctionAbstract::getClosureScopeClass, and ReflectionFunctionAbstract::getClosureThis - with a static method + with a static closure without an object context getClosure(); $r = new ReflectionFunction($c); -var_dump($r->getClosureThis()); // NULL -var_dump($r->getClosureScopeClass()); // self::class -var_dump($r->getClosureCalledClass()); // static::class + +var_dump($r->getClosureThis()); // NULL, since the pseudo-variable $this is not available in a static context +var_dump($r->getClosureScopeClass()); // Corresponds to the self::class resolution inside a closure +var_dump($r->getClosureCalledClass()); // Corresponds to the static::class resolution inside a closure ?> ]]>