You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 14, 2024. It is now read-only.
function __construct($q) {
echo "Constructor $q";
}
function a($a) {
echo 'A';
}
}
$x = new test('test');
$x->a();
?>`
I have created the following code snippet, and it works as expected. However I am missing any warning message about missing parameter. Since it is not optional, as there is no default value assigned to it, I believe there should be at least some information about that mistake.
What is more, if I implement additional a($a, $b) function which takes two arguments, the same code will execute the first function with matching name. I think that best solution would be that $x->a() returning NULL instead of executing some method/function that does not match parameters number.
Same happens if there are several methods with the same name / same number of parameters.
Only first declared is working and there is no information about duplicate function name.
In addition I were able to launch protected & private method from outside of class they were implemented.
`<?php
class test {
}
$x = new test('test');
$x->a();
?>`
I have created the following code snippet, and it works as expected. However I am missing any warning message about missing parameter. Since it is not optional, as there is no default value assigned to it, I believe there should be at least some information about that mistake.
What is more, if I implement additional a($a, $b) function which takes two arguments, the same code will execute the first function with matching name. I think that best solution would be that $x->a() returning NULL instead of executing some method/function that does not match parameters number.
Same happens if there are several methods with the same name / same number of parameters.
Only first declared is working and there is no information about duplicate function name.
In addition I were able to launch protected & private method from outside of class they were implemented.