Skip to content

Support PHP 8.0 Union types RFC #302

Closed
@TysonAndre

Description

@TysonAndre

https://wiki.php.net/rfc/union_types_v2 was merged into PHP master today. The grammar is https://wiki.php.net/rfc/union_types_v2#type_grammar

Union types of 2 or more types can now occur on

  • Properties
  • Parameters
  • Return types

For backwards compatibility of existing applications, this could be supported similarly to 59b37a8 - parse the first type in the union type (unless it started with ?, optionally), then parse any remaining types into a different property

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