Files that define symbols such as classes and variables may be included into many files. Simply performing that inclusion should have no effect on those files other than declaring new symbols. For instance, a file containing a class definition should not also contain side-effects such as ``++print++`` statements that will be evaluated automatically on inclusion. Logic should be segregated into symbol-only files and side-effect-only files. The type of operation which is not allowed in a symbol-definition file includes but is not limited to: 

* generating output
* modifying ``++ini++`` settings
* emitting errors or exceptions
* modifying global or static variables
* reading/writing files


== Noncompliant Code Example

----
<?php

print "Include worked!";

class foo {
  // ...
}
----


== Compliant Solution

----
<?php

class foo {

  public function log() {
    print "Include worked!";
  }

}
----


== See

* https://www.php-fig.org/psr/psr-1/[PHP-FIG Basic Coding Standard PSR1], 2.3 - Side Effects


ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)

include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]
