A few days ago, the company has a Daniel to give us these rookie to speak PHP, he is mainly about some dry goods, and grammar what the matter, which has a thinking problem:
PHP include_once,require_once, and Include,require usage scenarios and differences?
A lot of people know include,require, or the difference between include_once and include, here I don't say, but very few people deeply understand why there is include_once, what do I need to include?
The situation was the same, I also think it is very interesting, because I have made this mistake before, I think include_once or require_once can avoid file repeated loading, that every time with it on the line, why also use include, so that I have a long time to write PHP code, It's all *_once. Until someone said I was not good at it, I argued with him for a while, and thought that this would avoid repeated loading .... And then to the performance of this piece ... Just dawned.
Existence is not only reasonable, I believe many people understand this truth, the less process procedures, the less time consuming, the more efficient, and a well-designed program, often efficient, we return to the point, include_once before each load of the file needs to determine whether the file is loaded, and include is not used, So in fact, from the performance of the include is more efficient, it must now be asked, it can not avoid repeated loading ah, indeed, but the program is written by people, and the reason people are called people, is that we exist thinking, back to the beginning of the sentence, a good design program we can avoid these things from the early design. Oh, what if it can't be avoided? With include_once ah ....
The above describes the PHP include_once,require_once, and Include,require use of the scene and the difference. , including the aspects of the content, want to be interested in PHP tutorial friends helpful.