<?php
class Cliente {
private $id;
private $nome;
public function __construct($id = 0, $nome = NULL){
$this->id = $id;
$this->nome = $nome;
}
public function getId(){
return $this->id;
}
public function getNome(){
return $this->nome;
}
public function setId($value){
$this->id = $value;
}
public function setNome($value){
$this->nome = $value;
}
public function __set ($name,$value){
$this->$name = $value;
}
public function __get ($name){
return $this->$name;
}
}
$cliente = new Cliente();
$cliente->id = 1;
$cliente->nome = "Fulano 1";
echo $cliente->getId() . " " . $cliente->getNome();
// your code goes here
PD9waHAKCWNsYXNzIENsaWVudGUgewoJCXByaXZhdGUgJGlkOwoJCXByaXZhdGUgJG5vbWU7CgkJcHVibGljIGZ1bmN0aW9uIF9fY29uc3RydWN0KCRpZCA9IDAsICRub21lID0gTlVMTCl7CgkJCSR0aGlzLT5pZCAgID0gJGlkOwoJCQkkdGhpcy0+bm9tZSA9ICRub21lOwoJCX0KCQlwdWJsaWMgZnVuY3Rpb24gZ2V0SWQoKXsKCQkJcmV0dXJuICR0aGlzLT5pZDsKCQl9CgkJcHVibGljIGZ1bmN0aW9uIGdldE5vbWUoKXsKCQkJcmV0dXJuICR0aGlzLT5ub21lOwoJCX0KCQlwdWJsaWMgZnVuY3Rpb24gc2V0SWQoJHZhbHVlKXsKCQkJJHRoaXMtPmlkID0gJHZhbHVlOwoJCX0KCQlwdWJsaWMgZnVuY3Rpb24gc2V0Tm9tZSgkdmFsdWUpewoJCQkkdGhpcy0+bm9tZSA9ICR2YWx1ZTsKCQl9CgkJCgkJcHVibGljIGZ1bmN0aW9uIF9fc2V0ICgkbmFtZSwkdmFsdWUpewoJCQkkdGhpcy0+JG5hbWUgPSAkdmFsdWU7CgkJfQoJCXB1YmxpYyBmdW5jdGlvbiBfX2dldCAoJG5hbWUpewoJCQlyZXR1cm4gJHRoaXMtPiRuYW1lOwoJCX0KCX0KCQoJCgkkY2xpZW50ZSA9IG5ldyBDbGllbnRlKCk7CgkkY2xpZW50ZS0+aWQgICA9IDE7CgkkY2xpZW50ZS0+bm9tZSA9ICJGdWxhbm8gMSI7CgkKCWVjaG8gJGNsaWVudGUtPmdldElkKCkgLiAiICIgLiAkY2xpZW50ZS0+Z2V0Tm9tZSgpOwoKLy8geW91ciBjb2RlIGdvZXMgaGVyZQ==