RFC: remove restrictions from classes/interfaces/traits
Open
feature request
- Dominant language
- C++
- Stars
- 18.7k
- Forks
- 3.1k
- Avg merge
- 1h 47m
- Merged PRs (30d)
- 2
Description
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
Contributor guide
Assessment
This issue has not been assessed yet.