Use of require in PHP Library

Use of require in PHP Library

ayzayz Posts: 51Questions: 18Answers: 0

Within the code of PHP library, I see usage of require as opposed to require_once. Just curious as to why there was no performance concern in doing this from your end.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,627Questions: 1Answers: 10,090 Site admin
    Answer ✓

    I was confident enough that in the libraries each script was only included once, so we didn't need the (albeit minor) overhead of require_once (since it needs to look up what was loaded before).

    If you feel happier with it, you could certainly switch it to use require_once.

    Allan

This discussion has been closed.