<?php
class Users {
public $name;
public $idade;
public $email;
private $senha;
function __construct($name, $idade, $email, $senha){
$this->name = $name;
$this->idade = $idade;
$this->email = $email;
$this->setPassword($senha);
echo "O objeto foi contruido!";
}
function setPassword($senha) {
$this->senha = password_hash($senha, PASSWORD_DEFAULT);
} else {
die ('Sua senha deve conter entre 8 e 13 caracters'); }
}
}
$pessoa = new Users("Flavio", 19, "flvdeveloper@gmail.com", "testando123");
$pessoa->setPassword("testando123");
PD9waHAgCgpjbGFzcyBVc2VycyB7CglwdWJsaWMgJG5hbWU7IAoJcHVibGljICRpZGFkZTsKCXB1YmxpYyAkZW1haWw7Cglwcml2YXRlICRzZW5oYTsKCWZ1bmN0aW9uIF9fY29uc3RydWN0KCRuYW1lLCAkaWRhZGUsICRlbWFpbCwgJHNlbmhhKXsgCgkgICAgJHRoaXMtPm5hbWUgPSAkbmFtZTsKCSAgICAkdGhpcy0+aWRhZGUgPSAkaWRhZGU7CgkgICAgJHRoaXMtPmVtYWlsID0gJGVtYWlsOwoJICAgICR0aGlzLT5zZXRQYXNzd29yZCgkc2VuaGEpOwoJICAgIGVjaG8gIk8gb2JqZXRvIGZvaSBjb250cnVpZG8hIjsKCX0KCWZ1bmN0aW9uIHNldFBhc3N3b3JkKCRzZW5oYSkgewoJICAgIGlmIChzdHJsZW4oJHNlbmhhKSA+IDggYW5kIHN0cmxlbigkc2VuaGEpIDwgMTMpIHsKCSAgICAgICAgJHRoaXMtPnNlbmhhID0gcGFzc3dvcmRfaGFzaCgkc2VuaGEsIFBBU1NXT1JEX0RFRkFVTFQpOwoJICAgIH0gZWxzZSB7CgkgICAgICAgIGRpZSAoJ1N1YSBzZW5oYSBkZXZlIGNvbnRlciBlbnRyZSA4IGUgMTMgY2FyYWN0ZXJzJyk7CgkgICAgfQoJfQp9CiRwZXNzb2EgPSBuZXcgVXNlcnMoIkZsYXZpbyIsIDE5LCAiZmx2ZGV2ZWxvcGVyQGdtYWlsLmNvbSIsICJ0ZXN0YW5kbzEyMyIpOwp2YXJfZHVtcCgkcGVzc29hKTsKJHBlc3NvYS0+c2V0UGFzc3dvcmQoInRlc3RhbmRvMTIzIik7CnZhcl9kdW1wKCRwZXNzb2EpOwoK