#[ReturnTypeWillChange] Is For All

https://php-tips.readthedocs.io/en/latest/tips/returntypewillchange_for_all.html

4 points · 3 comments · view on lemmy.world

3 Comments

psion1369@lemmy.world · 3 pts · 154d

All the work to make PHP type safe and then we introduce this bullshit.

Arcanoloth@lemmy.ml · 1 pts · 154d

Ewww.

exakat@lemmy.world · 1 pts · 154d

#[ReturnTypeWillChange] is actually for PHP native interfaces, as they were initialy not enforced, until they were. It happens to apply to custom methods too. May be static analysis should report such usage, as it is probably a code smell.