Search code examples
phpperformancepage-load-time

Does opening and closing php tags multiple times increases page load?


Possible Duplicate:
Opening/closing tags & performance?

This is a newbie question, but I could not find a clear answer on the net, so please don't laugh :)

  1. Does opening and closing php tags ( <? php code ?>) multiple times increases page load time?

  2. How about using include templatepath multiple times?

Thank you


Solution

    1. Theoretically yes, but the difference is so miniscule that in almost all cases it wouldn't matter.

    2. Not sure about what you mean. If there is a possibility of a file being included multiple times, use include_once or require_once. This will prevent multiple loads and prevents errors like 'Cannot redeclare class'. Again this is more expensive than include and require, but more stable.

    As a side note, your questions are not anything related to code, and I am sure these have already been asked and answered multiple times in SO, so please try to search/ask better next time :)

    All the best!