When I posted my Idea of building a wrapper class for include_once and require_once, I didn't think, that the many php developer would like it. But I was wrong, fortunately.
Thanks to Mathias Taylor for benchmarking. Special thanks goes to Cristian Strian for his suggestion to optmize the class, and make it faster. That is the optimized wrapper class.
class includeWrapper{ public static $paths = array(); public static function includeOnce($path_file){ if(!isset(self::$paths[$path_file])){ include($path_file); self::$paths[$path_file] = true; } } public static function requireOnce($path_file){ if(!isset(self::$paths[$path_file])){ require($path_file); self::$paths[$path_file] = true; } } // just for testing public static function getPaths(){ return self::$paths; } } ?>