-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Anonymous Classes #1118
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
Anonymous Classes #1118
Conversation
Added test for ReflectionClass::isAnonymous()
This is excellent, I've been trying to integrate the old Anonymous class RFC into a custom build PHP, but this will make things a lot easier since it's designed for PHP 7. I wonder though, is it possible to make this into a .diff patch so I can play with its functionality on a linux server? |
Why not just grab the branch and build it? It’s slightly older than master, but changes are going to be pulled in shortly. Either way it runs just fine. -- From: HallofFamer [email protected] This is excellent, I've been trying to integrate the old Anonymous class RFC into a custom build PHP, but this will make things a lot easier since it's designed for PHP 7. I wonder though, is it possible to make this into a .diff patch so I can play with its functionality on a linux server? — |
@HallofFamer If you really need to download the diff in text form (instead of checking out the branch using git). you can add .patch (or .diff) to this pages url: |
@suralc: Oh thats excellent, thanks. I really love Anonymous and Nested class features, they make PHP's OO more complete. Good luck to this RFC! |
In the RFC, you mention |
Looks like How would be nested anonymous clases named? Imagine: $foo = new class {
function bar() {
return new class {};
}
};
var_dump(get_class($foo->bar())); |
@Majkl578 nothing broken about it. Check the RFC for more on naming things. Ignore |
Oh, yep, the names were off. The code just does That doesn't matter much, as relying on the class name or type hinting against it would be useless and wildly irresponsible. The RFC is now up to date with code output. |
@@ -1868,7 +1877,7 @@ ZEND_FUNCTION(get_defined_functions) | |||
array_init(&user); | |||
array_init(return_value); | |||
|
|||
zend_hash_apply_with_arguments(EG(function_table), copy_function_name, 2, &internal, &user); | |||
zend_hash_apply_with_arguments(EG(function_table), copy_function_name, 3, &internal, &user, &disabled); |
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.
The changes in this file seem unrelated.
Superseded by #1249. |
RFC: https://wiki.php.net/rfc/anonymous_classes
This is a work in progress right now and the RFC is being worked on, as are the tests.
Please keep feature discussions to the mailing list.