Use of require in PHP Library

Use of require in PHP Library

ayzayz Posts: 63Questions: 23Answers: 1

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: 63,455Questions: 1Answers: 10,465 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.