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

Union types in type hints and static typehint #21

Closed
Tracked by #1 ...
i582 opened this issue Jul 26, 2021 · 0 comments
Closed
Tracked by #1 ...

Union types in type hints and static typehint #21

i582 opened this issue Jul 26, 2021 · 0 comments

Comments

@i582
Copy link
Owner

i582 commented Jul 26, 2021

RFC: https://wiki.php.net/rfc/union_types_v2

The static type hint can only be used on a union return type.
This must be taken into account in the grammar.

Examples:

function f(int|string $a) {}
function f(): int|string {}

class Foo {
	public int|string $a;
}
This was referenced Jul 26, 2021
Closed
@i582 i582 closed this as completed Jul 27, 2021
@i582 i582 mentioned this issue Jul 30, 2021
17 tasks
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

No branches or pull requests

1 participant