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
ReflectionClass fails to properly identify unimplemented interface methods as abstract #5170
Comments
I've also found that |
At a cursory glance, I think this is the problem. I don't see those constants defined differently for ReflectionMethod from ReflectionFunction anywhere, 0x2 and x04 should be the correct values. |
Version 2.3.1 uses a different reflection methodology which is currently broken in HHVM (see facebook/hhvm#5170). Downgrading will allow our tests to pass while this issue is resolved.
@paulbiss That's not the problem. |
Relevant: http://3v4l.org/gD3G2 This is the part responsible for that. hhvm/hphp/runtime/ext/reflection/ext_reflection.cpp Lines 1166 to 1178 in fcdc18a
First of all, we don't need the I don't have time right now to figure out all the edge cases. Maybe we even need to check, not to add implemented methods twice. This should be a pretty good start for anyone wanting to take this. :) Edit: another case that is broken: http://3v4l.org/hCDTr |
@meghana1811 oops, looks like someone already sent a PR for this that landed -- sorry for not noticing that, should have seen the open PR :) You can look into the other small starter task. |
…rfaces Summary: This is a fix for #5170. I've introduced a second Set because we don't want to return abstract methods in parent classes which are implemented in the child class. Closes #5236 Reviewed By: @fredemmott Differential Revision: D2035770
"Version 2.3.1 uses a different reflection methodology which is currently broken in HHVM (see facebook/hhvm#5170). Downgrading will allow our tests to pass while this issue is resolved." Ref: thephpleague/commonmark@2a6a97c
I've identified a behavior difference / PHP incompatibility bug with
ReflectionClass
which occurs when an abstract method doesn't fully implement an interface:getMethods(ReflectionMethod::IS_ABSTRACT)
in HHVM will not return the missing method whereas PHP does.Here's some sample code:
And here's a quick test demonstrating the behavior mismatch:
Here's the PHP output:
Whereas HHVM produces a different result:
This issue was originally discovered here: sebastianbergmann/phpunit-mock-objects#223
The text was updated successfully, but these errors were encountered: