I am trying to create properties based on the method arguments. For example:
class Test{
public function newProperty($prop1,$prop2){
//I want to create $this->argu1 and $this->argu2 after calling newProperty method.
}
}
$test=new Test();
$test->newProperty('argu1','argu2')
Is this possible? Thanks for any helps.
as simple as:
suppose you wanted to handle an undefined number of arguments, you could use:
On the other hand, all this is quite unnecessary as all these properties will be public and thus:
would do exactly the same.