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:

Noncompliant Code Example

<?php

print "Include worked!";

class foo {
  // ...
}

Compliant Solution

<?php

class foo {

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

}

See