views:

116

answers:

2

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'
+2  A: 

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

Daniel A. White
+1  A: 

Either ways, an organized structure far out-weighs the small penalty spent on parsing a longer string.

Haoest