The performance of require() in php is similar to include(), and the usage method is basically the same.
The difference between them is that for include(), the file must be read and evaluated every time when include() is executed;
For require(), the code containing the file is only processed once.
This means that if there is code that contains one of these instructions and code that may be executed multiple times, it is more efficient to use require().
If you read a different file each time you execute the code, or if you have a loop that iterates through a set of files, use include(). You can read it every time because you can set a variable for the file name you want to include. , this variable is used when the parameter is include().
The above has introduced the comparison between include() and require() in PHP, including the relevant aspects. I hope it will be helpful to friends who are interested in PHP tutorials.