I have a class:
class A {
protected $nome;
public function getNome() {
return $this->nome . " exemplo";
}
public function setNome($nome) {
$this->nome = $nome;
}
}
When i use the code:
$r = new A();
$r->setNome("My");
json_encode($r);
the code not returns because of the protected property, if the property is public the code returns but does'nt returns correctly.