Open weirdan opened 2 years ago
https://psalm.dev/r/a3c5fd12fd?php=8.1 https://3v4l.org/AVKtm
PHPStan requires additional check to make sure property exists but otherwise behaves the same: https://phpstan.org/r/31d907e0-9e34-40c2-b0a3-76d4588eab65
Hack doesn't seem to have a functioning readonly implementation.
readonly
TypeScript requires jumping through some hoops, but ultimately allows the same: https://www.typescriptlang.org/play?#code/MYGwhgzhAEDC0G8BQ1XQE4FMwBMD2AdiAJ7QCWAXNAQK4C2ARputALzQCMA3EgL5JIAZjQLAALmULQ6NMWDF50ACjxU8DAFaZxASioA3PGRyIUaMoOhLMADzIQxEFQBpoAcjJudO02j-Q8ADoyNmgAFgAmHj9+fiERcUkCaFt7RwAeABVXAGkUmzFMAhwYAAV0PAAHZjFiHMxiAD4lM1R1DSps1uhKisqqHKQ9AM1yGEzoADJoACVtRRx0nNcRAGsCPAB3AkbfNCwxGnRkgHlNbTFA3rwFWurAgAtIE+3yqpriQOAwEBAVTVc10qOh4cWAhAc0GAoQImE2cB4MjkCmUwBBSHBBAgeBAmECIDwAHMlGiuEA
I found these snippets:
https://psalm.dev/r/a3c5fd12fd?php=8.1 https://3v4l.org/AVKtm
PHPStan requires additional check to make sure property exists but otherwise behaves the same: https://phpstan.org/r/31d907e0-9e34-40c2-b0a3-76d4588eab65
Hack doesn't seem to have a functioning
readonly
implementation.TypeScript requires jumping through some hoops, but ultimately allows the same: https://www.typescriptlang.org/play?#code/MYGwhgzhAEDC0G8BQ1XQE4FMwBMD2AdiAJ7QCWAXNAQK4C2ARputALzQCMA3EgL5JIAZjQLAALmULQ6NMWDF50ACjxU8DAFaZxASioA3PGRyIUaMoOhLMADzIQxEFQBpoAcjJudO02j-Q8ADoyNmgAFgAmHj9+fiERcUkCaFt7RwAeABVXAGkUmzFMAhwYAAV0PAAHZjFiHMxiAD4lM1R1DSps1uhKisqqHKQ9AM1yGEzoADJoACVtRRx0nNcRAGsCPAB3AkbfNCwxGnRkgHlNbTFA3rwFWurAgAtIE+3yqpriQOAwEBAVTVc10qOh4cWAhAc0GAoQImE2cB4MjkCmUwBBSHBBAgeBAmECIDwAHMlGiuEA