vimeo / psalm

A static analysis tool for finding errors in PHP applications
https://psalm.dev
MIT License
5.57k stars 660 forks source link

json_encode pure? #5418

Open orklah opened 3 years ago

orklah commented 3 years ago

I noticed json_encode is pure in stubs.

The JsonSerializable could theorically have side-effects: https://3v4l.org/naGsf

Should we keep it pure?

psalm-github-bot[bot] commented 3 years ago

Hey @orklah, can you reproduce the issue on https://psalm.dev ?

weirdan commented 3 years ago

Also it can change the result of json_last_error(_msg): https://3v4l.org/YIUvW, so it's not pure, at least in theory.