Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is exit/die without arguments pure? #10762

Open
kkmuffme opened this issue Feb 29, 2024 · 0 comments
Open

Why is exit/die without arguments pure? #10762

kkmuffme opened this issue Feb 29, 2024 · 0 comments

Comments

@kkmuffme
Copy link
Contributor

#6188 changed that exit with arguments is impure, however I think all calls to exit/die should be impure:

https://psalm.dev/articles/immutability-and-beyond

A pure function is one whose output is completely deterministic given its input, and which has no side effects

Exiting has side-effects - it will call the functions registered with register_shutdown_function. (and if you call this function again inside of a shutdown function, it will actually exit and not trigger the shutdown functions again).
Doesn't sound very pure to me, does it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants