Skip to content

RFC: remove restrictions from classes/interfaces/traits #7358

Open
@fredemmott

Description

@fredemmott

Mostly inherited from PHP5, for example:

  • can't put protected methods in interfaces
  • can't do instanceof MyTrait

There are also restrictions we've added, eg interfaces can't require implements (#7353)[

While this is technically a BC break, it's only one in that it makes HHVM more permissive - i.e. it will make previously-invalid code valid. Precedent:

  • we allow covariant return types and contravariant parameter types, PHP does not
  • all the PHP7 features that are enabled in PHP5 mode

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions