4 ms·
For the null-safe operator: I've not looked at PHP in years, but is that transpilation really correct? That is, does the original code really call getSchemaDefi
by hvdijk 6y ago
For the null-safe operator: I've not looked at PHP in years, but is that transpilation really correct? That is, does the original code really call getSchemaDefinitionResolver twice like the transpiled version does?
- deergomoo 6y agoI don’t believe so, no. So for impure or non-idempotent methods, the two versions would not be equivalent. Edit: it is indeed not the same https://3v4l.org/UNmAg https://3v4l.org/UNmAg
- withinboredom 6y agoThis is more correct: https://3v4l.org/nAtYp https://3v4l.org/nAtYp Note that the parens around the assignment are required to capture the assignment to `$result`.
- withinboredom 6y agoI opened a PR here: https://github.com/rectorphp/rector/pull/6101 https://github.com/rectorphp/rector/pull/6101
- hvdijk 6y agoThat looks like what I was expecting. Nice work!