Boas, tenho a seguinte Class:
<?
class PimPamPum {
var $random_id_out= '20';
public function getRandom()
{
$random_id = rand(0,5);
if ($random_id == $this->random_id_out){
//$this->random_id_out = $random_id;
//$this-> getRandom();
throw new Exception("igual");
}
else {
$teste['random_id_out']= $this->random_id_out;
$teste['random_id']= $random_id;
$this->random_id_out = $random_id;
return $teste;
}
throw new Exception("fez");
}
}
?>
O objectivo é retornar sempre um valor diferente do anterior, o
problema é que nao consigo definir o valor ($this->random_id_out =
$random_id;) da variável externa à função, devo estar a fazer alguma
coisa mal.
Alguém tem alguma ideia ?
Obrigado.
--~--~---------~--~----~------------~-------~--~----~
Recebeu esta mensagem porque está inscrito em Grupo "Mailing List da Comunidade
Portuguesa de Desenvolvimento de RIAs - www.riapt.org" do Grupos Google.
Para enviar mensagens para este grupo, envie um email para
[email protected]
Para anular a inscrição neste grupo, envie um email para [EMAIL PROTECTED]
Para mais opções, visite este grupo em
http://groups.google.com/group/riapt?hl=pt-PT
-~----------~----~----~----~------~----~------~--~---