-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Reflection API does not match PHP's Reflection API #5890
Comments
I'm not seeing the notices when I run the code snippet, I suspect they're unrelated. The rest seems rather implementation specific (you're reflecting on systemlib and many of the differences are naming related and otherwise invisible). I think at best this is low-pri, but I don't think supporting parity with systemlib parameter names is realistic. (http://3v4l.org/2JkWA) |
Not sure what you think this is about, but HHVM's implementation of |
Ah, that was not clear from the diff... |
Not from the diff, no. Sorry about that. But from sebastianbergmann/phpunit-mock-objects#229 (comment) linked from the first line of the issue :-) |
Is this equivalent to |
@SiebelsTim it is not equivalent, |
After a bit of checking, public function hasType() {
return $this->getTypeText() !== '';
} As I don't see a |
@Orvid of course it does not exist currently. It is part of the new PHP 7 API |
A big crux of this looks to be implementing https://github.com/tpunt/PHP7-Reference#reflection-additions |
Summary: This diff add the `ReflectionType` class which provides a bit of information re: type-hinted parameters and return types. Two new public methods are added to `ReflectionParameter` and `ReflectionFunctionAbstract` as to check for type-hint information and the create the actual `ReflectionType` Part of #5890 Reviewed By: jwatzman Differential Revision: D2526389 fb-gh-sync-id: 7f6c9066e375c00981dc35e5d921796472d2dbfd
Discovered via sebastianbergmann/phpunit-mock-objects#228 which is discussed in sebastianbergmann/phpunit-mock-objects#229.
This is just one example of where the Reflection API differs between HHVM and PHP:
The notices have been reported in #5888.
The text was updated successfully, but these errors were encountered: