-
Notifications
You must be signed in to change notification settings - Fork 804
Add stub/document ReflectionFunctionAbstract::getClosureCalledClass() #4043
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e1213d8
to
0d99784
Compare
Thank you! Maybe switch to draft for now? |
This is already done in #3895. |
0d99784
to
c1e7ac4
Compare
c1e7ac4
to
bc1fa9a
Compare
@arnaud-lb do you know how |
@Girgias it's related to https://www.php.net/manual/en/language.oop5.late-static-bindings.php#language.oop5.late-static-bindings.usage, and returns the same class that |
Not sure the example is good, but I kinda struggle with this concept myself |
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('reflectionfunctionabstract.getclosurecalledclass')/db:refsect1[@role='examples']/.)"> | ||
<xi:fallback/> | ||
</xi:include> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh this is funky. This would also have been an option for the curl multi docs.
The example is much too long. Use this: <?php
class A {
public function getClosure() {
var_dump(self::class, static::class);
return function () {
};
}
}
class B extends A {
}
$b = new B();
$c = $b->getClosure();
$r = new ReflectionFunction($c);
var_dump($r->getClosureThis() === $b);
var_dump($r->getClosureScopeClass()); // self::class
var_dump($r->getClosureCalledClass()); // static::class |
reference/reflection/reflectionfunctionabstract/getclosurecalledclass.xml
Outdated
Show resolved
Hide resolved
reference/reflection/reflectionfunctionabstract/getclosurecalledclass.xml
Outdated
Show resolved
Hide resolved
reference/reflection/reflectionfunctionabstract/getclosurecalledclass.xml
Outdated
Show resolved
Hide resolved
reference/reflection/reflectionfunctionabstract/getclosurescopeclass.xml
Outdated
Show resolved
Hide resolved
reference/reflection/reflectionfunctionabstract/getclosurethis.xml
Outdated
Show resolved
Hide resolved
Co-authored-by: Arnaud Le Blanc <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
For the record: LGTM. |
No description provided.