Assume private visibility for all class members by default.
All checks were successful
The build was successful.

In most (all?) modern OOP languages class members visibility is assumed to be private and programmer has to consciously set it to public or protected. PHP has the different approach what can cause a security flaws in written scripts. AerScript will not follow this way, as it seems to be conceptually broken.
This commit is contained in:
2019-05-17 08:40:41 +02:00
parent 48ccd7fef0
commit 55acf8111f
41 changed files with 72 additions and 84 deletions

View File

@@ -1,6 +1,6 @@
class Program {
string cycle(char $a, char $b, int $i = 0) {
private string cycle(char $a, char $b, int $i = 0) {
static bool[] $switches;
if($switches[$i])
$switches[$i] = !$switches[$i];
@@ -9,7 +9,7 @@ class Program {
return ($switches[$i]) ? $a : $b;
}
void main() {
public void main() {
for(int $i = 1; $i < 3; $i++) {
print($i + $this->cycle('a', 'b') + PHP_EOL);
for(int $j = 1; $j < 5; $j++) {