1
Good morning,
I wrote a PHP class
<?php
private $v;
private $v2;
private $v3;
public function __construct(){
printf("Objeto criado com sucesso!");
}
public function setValor(){
$this->$v = "valor";
$this->$v2 = "valor2";
$this->$v3 = "valor3";
}
public function getValor1(){
return $this->$v;
}
public function getValor2(){
return $this->$v2;
}
public function getValor3(){
return $this->$v3;
}
}
$t = new Teste();
$t->setValor();
?>
But I can’t access serValor() method, I always get GET 500 error (Internal Server Error), however I don’t see anything wrong in the code, someone can help?
I find it strange to be only in this method: experiment:
$this->v = "valor";
without the "$" at all– Miguel