Search code examples
phppathincluderelative-pathabsolute-path

Is require '/home/../http/' as fast as require '/http/'?


I know that it is poor performance to use relative paths when including a file in php. But, is this true for for all paths or just paths relative to the assumed (context) include path?

Is this line

require '/home/../http/test.php'

as fast as this line

require '/http/test.php'

Solution

  • Basically yes. These paths are basically resolved first by php/apache then operating system.