In this example:
class Database { private $host, $database, $username, $password, $type; public $active_connection; //Some methods } class Page { private $db; public function __construct($id) { // Some code $this->db = new Database($id); } //Some Methods } $page = new Page(0); var_dump($page);
This will lead to the issuance of private variables of the database object, although they are marked as private (and, as I understand it, unsuitable for the outside world).
My questions:
- Is this a security risk?
- Is there a way to effectively hide these variables marked as private?
early
EDIT: In this project, the admin section will provide the ability to create your own PHP scripts for inclusion in the site as sections. Since this is being developed by a third-party organization, my concern is that for some reason, the customer unintentionally unloads the $ page object (which in our code is the main modifiable object) in order to "examine" it.
Tivie source share