4
I have a question of how to send the data to create a goal, I read in some tutorials that was just put this way in PHP4:
$elo1=new Elo(1300);
$elo1->fc_Elo();
However the way I saw in some places of the web, it gets very extensive the code, has some way as in the middle above for the current version of PHP?
This is the original code that’s working:
class Elo{
public $mmr;
function fc_Elo(){
if($this->mmr == 1300){
echo "Teste".$this->mmr;
}
else{
echo "1".$this->mmr;
}
}
}
$elo1=new Elo;
$elo1->mmr = 1300;
$elo1->fc_Elo();
I don’t understand, you wonder if in php5 it is possible to pass argument in the constructor?
– rray
In php4 to give information to the object and this way: $elo1=new Elo(1300, value2, Valor3); I would like it in a similar way, instead of passing each information in each line, example of the current: $elo1->mmr = 1300; $elo1->valor2 = xxx; $elo1->Valor3 = yyy;
– Alex Vasconcelos