Skip to content
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

Several instanceof instances need to be treated as a union type (or, better, an intersection type) #339

Closed
YuriyNasretdinov opened this issue Jan 22, 2020 · 1 comment · Fixed by #1058

Comments

@YuriyNasretdinov
Copy link
Contributor

Code Example

<?php
class A { public function c() { return 1; } }
class B { public function c() { return 2; } }

function test($a) {
if ($a instanceof A || $a instanceof B) {
 echo $a->c();
}
}

Actual Behavior

Call to undefined method {mixed}->c();

Expected Behavior

No errors.

@i582
Copy link
Contributor

i582 commented Aug 25, 2021

Done by #1058

@i582 i582 closed this as completed Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants