Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Handle condition with always true/false sub-condition #3313

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

Closed

Conversation

@VincentLanglet
Copy link
Contributor

@VincentLanglet VincentLanglet commented Aug 9, 2024

@VincentLanglet VincentLanglet changed the base branch from 1.12.x to 1.11.x August 9, 2024 12:32
Copy link
Collaborator

You've opened the pull request against the latest branch 1.12.x. If your code is relevant on 1.11.x and you want it to be released sooner, please rebase your pull request and change its target to 1.11.x.

$this->createFunctionCall('is_string', 'bar'),
),
[],
['$foo' => 'int'],
Copy link
Contributor Author

@VincentLanglet VincentLanglet Aug 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since bar is an object

$this->scope = $this->scope->assignVariable('bar', new ObjectType('Bar'), new ObjectType('Bar'));

we can be sure foo is an int.

I added the same test with is_int($foo) || is_string($mixed) to reproduce the old behavior.

[
new Expr\Empty_(new Variable('array')),
[
'$array' => 'array{}|null',
Copy link
Contributor Author

@VincentLanglet VincentLanglet Aug 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since array is defined as an non nullable array

$this->scope = $this->scope->assignVariable('array', new ArrayType(new MixedType(), new MixedType()), new ArrayType(new MixedType(), new MixedType()));

we can be sure it's an array.

Copy link
Contributor

staabm commented Oct 23, 2025

@VincentLanglet do you remember why you closed this PR?

I think this fix would be useful to fix a few of the ~1200 errors

Copy link
Contributor Author

@VincentLanglet do you remember why you closed this PR?

I think this fix would be useful to fix a few of the ~1200 errors

No I don't... Maybe it wasn't working ?

You can try to reopen it on 2.1.x to see the result of the build

staabm reacted with thumbs up emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

array_key_exist inference is lost when adding a false condition

AltStyle によって変換されたページ (->オリジナル) /