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,15 +1,15 @@
class Luhn {
private string $number;
string getNumber() {
public string getNumber() {
return $this->number;
}
void setNumber(string $number) {
public void setNumber(string $number) {
$this->number = $number;
}
bool validate() {
public bool validate() {
string $sum;
string $revNumber;
int $len;
@@ -26,7 +26,7 @@ class Luhn {
class Program {
private const NUMBERS = {'3788803280', '6487308345', '5443489710530865', '5539266155200609', '4024007151066296', '4345234978'};
void main() {
public void main() {
int $i, $nums = sizeof($this->NUMBERS);
object $luhn = new Luhn();