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.
此提交包含在:
@@ -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++) {
|
||||
|
||||
新增問題並參考
封鎖使用者