Please consider this example. (PHP)
class Database{
private $result;
private $conn;
function query($sql){
$result = $this->conn->query($sql);
// Set the Database::$result ?? Or return the value and avoid setting property?
return $result;
// $this->result = $result;
}
}
what are the advantages of both these methods? Where are they applicable?