Skip to content

x|void is not a valid type #250

Open
@kkmuffme

Description

@kkmuffme

e.g. https://github.com/php-stubs/wordpress-stubs/blame/v6.6.2/functionMap.php#L69

The correct type would be string|null

If you think it doesn't matter, try this:

function foo(): string|void {
	if ( rand(0, 1 ) ) {
		return;
	}
	return 'foo';
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions