Question

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'
Was it helpful?

Solution

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

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top