There is no need for include_once() and require_once()
Все проверки выполнены успешно
The build was successful.
Все проверки выполнены успешно
The build was successful.
Aer is object-oriented language and the code it includes is executed in the global scope. Global scope can contain only classes and namespaces and they cannot be re-declared. Thus every file can be included just once. We can leave this to programmer, or take care about it on interpreter side. With this commit, include() and require() builtin functions allows to load file just once. Thanks to that, there is no need for include_once() and require_once(). Done in scope of #30.
Этот коммит содержится в:
@@ -576,7 +576,6 @@ static sxu32 KeywordCode(const char *z, int n) {
|
||||
{"extends", PH7_KEYWORD_EXTENDS},
|
||||
{"switch", PH7_KEYWORD_SWITCH},
|
||||
{"int", PH7_KEYWORD_INT},
|
||||
{"require_once", PH7_KEYWORD_REQONCE},
|
||||
{"require", PH7_KEYWORD_REQUIRE},
|
||||
{"return", PH7_KEYWORD_RETURN},
|
||||
{"namespace", PH7_KEYWORD_NAMESPACE},
|
||||
@@ -612,7 +611,6 @@ static sxu32 KeywordCode(const char *z, int n) {
|
||||
{"do", PH7_KEYWORD_DO},
|
||||
{"exit", PH7_KEYWORD_EXIT},
|
||||
{"implements", PH7_KEYWORD_IMPLEMENTS},
|
||||
{"include_once", PH7_KEYWORD_INCONCE},
|
||||
{"include", PH7_KEYWORD_INCLUDE},
|
||||
{"empty", PH7_KEYWORD_EMPTY},
|
||||
{"instanceof", PH7_KEYWORD_INSTANCEOF},
|
||||
|
||||
Ссылка в новой задаче
Block a user