There is no need for include_once() and require_once()
All checks were 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.
This commit is contained in:
2018-08-16 16:12:29 +02:00
parent 510410096b
commit b5fe36c14b
4 changed files with 13 additions and 97 deletions

View File

@@ -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},