Consider the following:
class MyClass {
public static function MyIncludingMethod() {
include_once("includes.php");
}
public static function MyOtherMethod() {
}
}
Assuming this is valid- when will includes.php be included?
Option 1) When the php file containing all of this is included
Option 2) When MyClass::MyIncludingMethod() is called
Option 3) When anything from MyClass is called, even if MyClass::MyIncludingMethod() has not been called
includes.php:
<?php
touch('i_was_called.txt');
?>
Results
Everything is as expected :)