ClassicPress PetitionsClassicPress Petitions
This is a read-only archive. Post or comment on the live version of this page on our forums.

Remove side-effects

June 30, 2019 · 13:43 · Viktor Szépe
Description

PSR-1 says

> A file SHOULD declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it SHOULD execute logic with side effects, but SHOULD NOT do both.

https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md#23-side-effects

We have class files and files full of functions with side-effects It would be the first step towards class autoloading.

Voters
Discussion
Viktor Szépe

A better title could be "Separate side-effects"