Wszystkie etapy powiodły się
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.
16 wiersze
263 B
Plaintext
16 wiersze
263 B
Plaintext
class Program {
|
|
|
|
private int factorial(int $num) {
|
|
if($num == 0 || $num == 1)
|
|
return 1;
|
|
else
|
|
return $num * $this->factorial($num - 1);
|
|
}
|
|
|
|
public void main() {
|
|
int $num = 7;
|
|
print('Factorial of ', $num, ' is ', $this->factorial($num), '.');
|
|
}
|
|
|
|
}
|