PHP: The include() include_once() performance debate

The conventional wisdom always said that PHP’s include()/require() was quicker than include_once()/require_once(), but recently I came across an interesting post by Arin Sarkissian which suggests otherwise.

Also I found more commentary on the performance benefit of using relative versus absolute paths in include()/require() and include_once()/require_once() statements (although the main article’s conclusions contradict Arin’s experiments). The Drupal developers discussed and benchmarked the relative/absolute include() issue too.

So in keeping with the spirit of quick and dirty experimentation I hacked up some code and ran some tests on include()/require() against include_once()/require_once() and on the relative/absolute path issue. The results are pretty surprising and I love to hear some views.

Continue reading ‘PHP: The include() include_once() performance debate’ »

Leave a Reply