I have a question Regarding PHP Basic Coding Standards PSR1. PSR 1 Rule 2.3 states:
Rule 2.3 Side Effects
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.The phrase "side effects" means execution of logic not directly related to
declaring classes, functions, constants, etc., merely from including the file."Side effects" include but are not limited to: generating output, explicit
use of 'require' or 'include', connecting to external services, modifying ini
settings, emitting errors or exceptions, modifying global or static variables,
reading from or writing to a file, and so on.
Can someone give me an argument that supports use of this rule? Or, explain the benefit of this rule, and why it is important or a good idea to implement. This will help me support full implementation of PSR 1 and make a good case.